Thread View: comp.windows.ms.programmer
5 messages
5 total messages
Started by Bengt Lindstr|m
Wed, 07 Nov 1990 10:28
pathname
Author: Bengt Lindstr|m
Date: Wed, 07 Nov 1990 10:28
Date: Wed, 07 Nov 1990 10:28
4 lines
606 bytes
606 bytes
We are developing a communications program for windows 3.0 and needs to know our programs pathname at runtime. We have tried to find it in the environment, but twe only found the kernel's pathname there. Does anyone know how to get it?
Re: pathname
Author: Hans van Oostrom
Date: Wed, 07 Nov 1990 22:26
Date: Wed, 07 Nov 1990 22:26
19 lines
1458 bytes
1458 bytes
In article <0A541F131D9F40032C@njord.fek.su.se> BLI@fek.su.se (Bengt Lindstr|m) writes: >We are developing a communications program for windows 3.0 and needs to >know our programs pathname at runtime. We have tried to find it in the >environment, but twe only found the kernel's pathname there. Does anyone >know how to get it? There is as you probably know the variable __argv available, which is the processed commandline. Standard C provides the program name as argv[0]. The fact that in a windows program argv[0] contains kern286.exe or equal should be concidered to be a bug. Since this all is parsed by windows before you can get your hands on it, it will be very difficult to get the program name. By the way the variable __argv is only spelled correctly (two __ ) on page 2-16 of the guide to programming, all other references are spelled as _argv, which of cource doesn't work. Hans van Oostrom hans@joker.mil.ufl.edu
Re: pathname
Author: Kai-Uwe Rommel
Date: Thu, 08 Nov 1990 09:45
Date: Thu, 08 Nov 1990 09:45
16 lines
1233 bytes
1233 bytes
In article <0A541F131D9F40032C@njord.fek.su.se> BLI@fek.su.se (Bengt Lindstr|m) writes: >We are developing a communications program for windows 3.0 and needs to >know our programs pathname at runtime. We have tried to find it in the >environment, but twe only found the kernel's pathname there. Does anyone Use GetModuleName() on your hInstance to get the full path name of your program. I hope GetModuleName() is the correct name, I don't have the refman here but I already used this function some time ago. Kai Uwe Rommel -- /* Kai Uwe Rommel * Munich * rommel@lan.informatik.tu-muenchen.dbp.de */
Re: pathname
Author: Morris Jones
Date: Thu, 08 Nov 1990 18:01
Date: Thu, 08 Nov 1990 18:01
14 lines
1048 bytes
1048 bytes
rommel@lan.informatik.tu-muenchen.dbp.de (Kai-Uwe Rommel) writes: >Use GetModuleName() on your hInstance to get the full path name of your >program. I hope GetModuleName() is the correct name, I don't have the >refman here but I already used this function some time ago. According to QuickHelp, it's GetModuleFileName() ... good reference! I didn't know about this one. Mojo -- mojo@netcom.UUCP Site Coordinating Instructor, San Jose South Morris "Mojo" Jones Skilled Motorcycling And Rider Training (S.M.A.R.T.) Campbell, CA 800-675-5559 ... 800-CC-RIDER
Re: pathname
Author: Chris GUZAK
Date: Sat, 10 Nov 1990 00:19
Date: Sat, 10 Nov 1990 00:19
10 lines
726 bytes
726 bytes
In article <0A541F131D9F40032C@njord.fek.su.se> BLI@fek.su.se (Bengt Lindstr|m) writes: >.. needs to >know our programs pathname at runtime. GetModuleFileName() will do the trick. You may have to GetModuleHandle() on yourself, or perhaps you can pass your hInst as well... (david?) Chris Guzak
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads