PDA

View Full Version : اشکال این کد کجاست؟



vahid_CPP
یک شنبه 08 شهریور 1383, 00:56 صبح
<span dir=ltr>سلام دوستان
من یه کدی رو روی Borland C++ امتحان کردم؛ درست کار کرد. کد هم مربوط به اجرای فایلهای صوتی تصویری هستش.
ولی وقتی این کد رو بوردم رو VC++ .net اجرا کنم؛ اشکال لینک میگیره. نمیدونم چرا و باید چیکارش کنم
کد رو این زیر واستون گذاشتم
لطفاً اگه میدونید مشکل کجاست؛ منو راهنمایی کنید.
ممنون
<span dir=ltr></span>
#include &lt;windows.h>
#include &lt;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(&amp;wndclass);
}

hwnd = CreateWindowEx(0l, achWndClass, achAppName, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL,
NULL, hInstance, NULL);
ShowWindow(hwnd, cmdShow);

while(GetMessage(&amp;msg, 0, 0, 0))
{
TranslateMessage(&amp;msg);
DispatchMessage(&amp;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>

Trash
یک شنبه 08 شهریور 1383, 10:07 صبح
باید فایل Vfw32.lib رو در قسمت Link پروژه اضافه کنی .

good_devil
یک شنبه 08 شهریور 1383, 11:20 صبح
IAVIFile::EndRecord
The EndRecord method writes the "REC" chunk in a tightly interleaved AVI file (having a one-to-one interleave factor of audio to video). Called when an application uses the AVIFileEndRecord function.

HRESULT EndRecord(
PAVISTREAM pf
);

Parameters

pf

Pointer to the interface to a file.

Return Values

Returns the HRESULT defined by OLE.

Remarks

This file handler method is typically not used.

For handlers written in C++, EndRecord has the following syntax:

HRESULT EndRecord(VOID);

Requirements

Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Library: Use Vfw32.lib.

See Also

Custom File and Stream Handlers, Custom File and Stream Handler Interfaces, AVIFileEndRecord



--------------------------------------------------------------------------------

© 2004 Microsoft Corporation. All rights reserved.

فکر کنم حالا اشکالشو بفهمی :idea:

good_devil
یک شنبه 08 شهریور 1383, 11:23 صبح
برای ذرست دیدن متن توی notepad کپی کنید :oops: :flower:

vahid_CPP
چهارشنبه 18 شهریور 1383, 00:08 صبح
tashakor tarash joon! rahnemaiit ostad shod