Re: Windows API in VC++

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alfred (anonymous_at_discussions.microsoft.com)
Date: 10/08/04


Date: Fri, 8 Oct 2004 09:29:29 +0800

I have look at the code reference, and this is my code:

HWND hWnd ;
int Rtval = ShellExecute(hWnd, "Open", "notepad.exe", NULL, NULL, 0);

I always get error during compile:
error C2440: 'initializing' : cannot convert from 'struct HINSTANCE__ *' to
'int'

can anyone help me this? i'm new in this...

thanks!

"CheckAbdoul" <checkabdoul at mvps dot org> wrote in message
news:%23W4KOHHrEHA.2948@TK2MSFTNGP11.phx.gbl...
> Take a look at the ShellExecute documentation.
>
>
> http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp
>
> --
> Cheers
> Check Abdoul [VC++ MVP]
> -----------------------------------
>
> "Alfred" <anonymous@discussions.microsoft.com> wrote in message
> news:ehjEevErEHA.1152@TK2MSFTNGP11.phx.gbl...
>> Can anyone please help me... i'm new in VC++.
>>
>> I like to have an example of calling Windows API in VC++.
>> some sample code of using ShellExecute to open notepad.exe.
>>
>> some explanation on the parameter will be very helpful.
>>
>> Thanks in advance.
>>
>>
>>
>>
>>
>
>



Relevant Pages

  • Re: Build Errors
    ... However this is the first time in all my examples that I had ... >> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInnstance, ... >> LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM ...
    (microsoft.public.vc.language)
  • RE: MoveWindow not sending WM_SIZE on deeply nested windows
    ... > window whose size I've requested to change. ... > int find_window (HWND hwnd) { ... > void display_error { ...
    (microsoft.public.win32.programmer.ui)
  • Re: Windows API in VC++
    ... >I have look at the code reference, ... > HWND hWnd; ... 'ShellExecute' returns HINSTANCE, not an int. ...
    (microsoft.public.vc.language)
  • Re: Button with Bitmap Disabled problem
    ... LRESULT CALLBACK ButtonProc (HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM ... BOOL DitherBlt(HDC hDestDC, int x, int y, int nWidth, int nHeight, HDC ...
    (microsoft.public.win32.programmer.ui)
  • Re: Build Errors
    ... void Show (HWND hwnd, HDC hdc, int xText, int yText, int iMapMode, ... LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM ...
    (microsoft.public.vc.language)