vahid_CPP
یک شنبه 08 شهریور 1383, 01:56 صبح
<span dir=ltr>سلام دوستان
من یه کدی رو روی Borland C++ امتحان کردم؛ درست کار کرد. کد هم مربوط به اجرای فایلهای صوتی تصویری هستش.
ولی وقتی این کد رو بوردم رو VC++ .net اجرا کنم؛ اشکال لینک میگیره. نمیدونم چرا و باید چیکارش کنم
کد رو این زیر واستون گذاشتم
لطفاً اگه میدونید مشکل کجاست؛ منو راهنمایی کنید.
ممنون
<span dir=ltr></span>
#include <windows.h>
#include <vfw.h>
LRESULT CALLBACK EPProc(HWND, UINT, WPARAM, LPARAM);
char achWndClass[] = "EP:Main";
char achAppName[] = "Easy Player 1.0";
HINSTANCE hInst;
int PASCAL
WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int cmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
hInst = hInstance;
if(!hPrevInstance)
{
wndclass.lpszClassName = achWndClass;
wndclass.hInstance = hInstance;
wndclass.lpfnWndProc = EPProc;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(1));
wndclass.lpszMenuName = NULL;
wndclass.hbrBackground = (HBRUSH)COLOR_WINDOW;
wndclass.style = NULL;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
RegisterClass(&wndclass);
}
hwnd = CreateWindowEx(0l, achWndClass, achAppName, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL,
NULL, hInstance, NULL);
ShowWindow(hwnd, cmdShow);
while(GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK
EPProc(HWND hwnd, UINT mMsg, WPARAM wParam, LPARAM lParam)
{
switch(mMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_LBUTTONDOWN:
MCIWndCreate(hwnd, hInst, MCIWNDF_SHOWALL, "e:\\mp3\\m\\08.mp3");
break;
default:
return(DefWindowProc(hwnd, mMsg, wParam, lParam));
}
return 0l;
}</span>
من یه کدی رو روی Borland C++ امتحان کردم؛ درست کار کرد. کد هم مربوط به اجرای فایلهای صوتی تصویری هستش.
ولی وقتی این کد رو بوردم رو VC++ .net اجرا کنم؛ اشکال لینک میگیره. نمیدونم چرا و باید چیکارش کنم
کد رو این زیر واستون گذاشتم
لطفاً اگه میدونید مشکل کجاست؛ منو راهنمایی کنید.
ممنون
<span dir=ltr></span>
#include <windows.h>
#include <vfw.h>
LRESULT CALLBACK EPProc(HWND, UINT, WPARAM, LPARAM);
char achWndClass[] = "EP:Main";
char achAppName[] = "Easy Player 1.0";
HINSTANCE hInst;
int PASCAL
WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int cmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
hInst = hInstance;
if(!hPrevInstance)
{
wndclass.lpszClassName = achWndClass;
wndclass.hInstance = hInstance;
wndclass.lpfnWndProc = EPProc;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(1));
wndclass.lpszMenuName = NULL;
wndclass.hbrBackground = (HBRUSH)COLOR_WINDOW;
wndclass.style = NULL;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
RegisterClass(&wndclass);
}
hwnd = CreateWindowEx(0l, achWndClass, achAppName, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL,
NULL, hInstance, NULL);
ShowWindow(hwnd, cmdShow);
while(GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK
EPProc(HWND hwnd, UINT mMsg, WPARAM wParam, LPARAM lParam)
{
switch(mMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_LBUTTONDOWN:
MCIWndCreate(hwnd, hInst, MCIWNDF_SHOWALL, "e:\\mp3\\m\\08.mp3");
break;
default:
return(DefWindowProc(hwnd, mMsg, wParam, lParam));
}
return 0l;
}</span>