Help, comdlg OPEN doesn't work 
Author Message
 Help, comdlg OPEN doesn't work

What's wrong with the following:

        LPOPENFILENAME openStruct;
        openStruct->hwndOwner = hwndDlg;
        openStruct->lpstrFilter = "*.*";
        openStruct->nMaxFile = 256;
        openStruct->Flags = OFN_LONGNAMES | OFN_PATHMUSTEXIST;
        GetOpenFileName(openStruct);

When this code is run nothing happens.  I was excpecting the "Open"
dialog box to appear????  I step through it and it just executes each
line and continues on to the next (including GetOpenFileName).

Thanks in advance.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 03 Aug 2002 03:00:00 GMT  
 Help, comdlg OPEN doesn't work

Quote:
>What's wrong with the following:

>    LPOPENFILENAME openStruct;
>    openStruct->hwndOwner = hwndDlg;

It's a miracle it doesn't crash! You're writing to thin-air. Try this
instead:

        OPENFILENAME openStruct;
        openStruct.hwndOwner = hwndDlg;
        etc...

Dave
--
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Sun, 04 Aug 2002 03:00:00 GMT  
 Help, comdlg OPEN doesn't work
LPOPENFILE name is just a pointer.
If you want to use it, you should allocate it before:
LPOPENFILENAME lpof = new(OPENFILENAME),
but it's not worth the effort.
Simply put:
OPENFILENAME of
of. .....
and pass &of to GetOpenFileName


Sun, 04 Aug 2002 03:00:00 GMT  
 Help, comdlg OPEN doesn't work
Thanks, changing LPOPENFILENAME to OPENFILENAME worked.



Quote:
> LPOPENFILE name is just a pointer.
> If you want to use it, you should allocate it before:
> LPOPENFILENAME lpof = new(OPENFILENAME),
> but it's not worth the effort.
> Simply put:
> OPENFILENAME of
> of. .....
> and pass &of to GetOpenFileName

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 05 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Why my open connection doesn't work?

2. RtlFreeHeap ADO Connection Open() doesn't work no more in Debug Mode

3. Help? Why the program doesn't work

4. Help: CLSIDFromProgID doesn't work.

5. Help doesn't work Visual Studio 6.0

6. Help, my RegCreateKeyEx() doesn't work in win98

7. Help doesn't work in VC6

8. Help:standard list doesn't work !

9. Help!!!Button from word doesn't work.

10. when edit , the F1 online help doesn't work

11. HELP: VerfindFile doesn't work

12. SaveBarState (WORKS) LoadBarState(Doesn't Work)?

 

 
Powered by phpBB® Forum Software