Re: Command-line arguments on start up.



In general, yes. Since, when WinMain exits the program is over, it's OK in
this case, too. You might find that the pointer is invalid in some contexts
(it might be bad in other threads or something), but generally it should be
fine.

Paul T.

"elena" <elena@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7EB599DC-B2E2-4BFF-B358-A26DE358B4DC@xxxxxxxxxxxxxxxx
> Hi, Paul,
> No problem in the code above, it works great.
> My question is: Is it ok to assign one pionter to another?
>
> Thank you,
> elena
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> lpCmdLine is the command line, in Unicode, of course. Is there a
>> problem?
>> You haven't asked any questions...
>>
>> Paul T.
>>
>> "elena" <elena@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:EB5E3FDC-AE8C-42F0-BA39-B249BA2D67DE@xxxxxxxxxxxxxxxx
>> > Hi, All
>> >
>> > I am not sure that this is the right way to receive to access
>> > command-line
>> > arguments when the App. starts up. The argument is string, which will
>> > be
>> > used
>> > as
>> > file name later in the program
>> >
>> > Please, advice
>> >
>> > LPTSTR m_lpCmdLine;
>> >
>> > int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
>> > LPTSTR lpCmdLine, int nCmdShow)
>> > {
>> > MSG msg;
>> > HACCEL hAccelTable;
>> > m_lpCmdLine = lpCmdLine; // actually i assign pointer to
>> > pointer ???
>> >
>> > if ( !InitInstance( hInstance, nCmdShow))
>> > {
>> > return FALSE;
>> > }
>> >
>> > hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_IMAGERSAMPLE);
>> >
>> > while (GetMessage(&msg, NULL, 0, 0))
>> > {
>> > if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
>> > {
>> > TranslateMessage(&msg);
>> > DispatchMessage(&msg);
>> > }
>> > }
>> > return msg.wParam;
>> > }
>>
>>
>>


.



Relevant Pages

  • Re: Command-line arguments on start up.
    ... Since, when WinMain exits the program is over, it's OK in ... You might find that the pointer is invalid in some contexts ... >> Hi, Paul, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: What evil things!
    ... Hey, I was not impressed with the things, Paul was trying to squish the bug ... Last night Pointer was tacked ... forwrd going horse but he so looked after Paul. ... Both Paul and I were trying to whack the wasp come something ...
    (uk.rec.equestrian)
  • What evil things!
    ... Paul got on and I kept Pointer on a lunge line and the horse was an absolute ... So today we decided to go back down to the yard Paul tacked up Pointer ... great big sort of Wasp I think came over and you could see it curl its ...
    (uk.rec.equestrian)
  • Re: What evil things!
    ... Last night Pointer was tacked up, ... going horse but he so looked after Paul. ... Both Paul and I were trying to whack the wasp come something ...
    (uk.rec.equestrian)
  • Re: MmMapIoSpace problem!!
    ... > int WINAPI WinMain(HINSTANCE hInstance, ... > PBYTE MappedAddress; ... If you get someting else then a null pointer you can read ... >> int WINAPI WinMain(HINSTANCE hInstance, ...
    (microsoft.public.windowsce.embedded.vc)

Loading