|
Yes, you need to call AllocConsole (or the less useful AttachConsole) when you're not in a console application; Windows call it for you when you are starting a console application, but not in a GUI app.
Concussus surgo.
When struck I rise.
|
|
|
|
|
Hi,
I wanna terminate another application given by handle (hWnd) programmatically.
I tried
CWnd* pWnd = FromHandle(hWnd);
pWnd->DestroyWindow();
and also
pWnd->SendMessage(WM_DESTROY);
without much effect.
Could somebody please help
Thanks
R.
|
|
|
|
|
I have tried
pWnd->SendMessage(WM_CLOSE);
with no effect. BUT
pWnd->PostMessage(WM_CLOSE);
works just fine.
Case solved.
R.
|
|
|
|
|
I have made a dll file that contains a few menus and a few dialogs.
This dll hooks and see if certain window is appeared or not.(Hooking WM_SHOWWINDOW)
If it receives the message, it adds the menu to the end of the menu bar,
and make set the wndproc to new subclass in dll file to intercept the new menu message.
When user click the item in extended menu, then it opens dialog box in the resource.
Now, I have 3 dialogs.
1 contains 3 Statics.
2 contains 1 Checkbox, 3 Statics, 2 Slider(Trackbar), 2 Edit box.
3 contains 1 Checkbox, 1 Statics.
2 and 3 is contained by propertysheet.
Dialog 2 works perfectly fine. The color is fine, the slider bar, checkbox, and editbox are all working fine.
However, 1 and 3 are very strange.
the statics in dialog 1 has white background color, whereas the background of the window is grey.
the statics in dialog 3 is the same thing, white background color, and the check box has black background color and cannot be checked.
I dont know why this is like this because i made all of them in same way.
Does anyone know how to fix this thing? Thx
|
|
|
|
|
I am looking for some code that will copy all the files in one folder to another some where else?
|
|
|
|
|
system("cmd.exe /c xcopy * destination");
Replace destination with the destination of your choice.
|
|
|
|
|
wont that just copy the file cmd.exe not a folder?
|
|
|
|
|
No, it will run CMD.EXE (the command processor) and the /C is perform automatically a command, in this case XCOPY *.* destination.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
|
Hi, i was looking for it to be a console app? if that is possable because i dont know much about the workings of windows yet
|
|
|
|
|
// main goes here
system("xcopy src dest");
have a look at xcopy syntax (xcopy /?)
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
|
Hi,
I am trying to call some methods from a dll provided by IBM as part of it's emulator API (PCSAPI).IBM's documentation recommends implicit linking. I lost the original lib file so I made one with with the implib utility that comes with Borland C++ Builder. This works fine in C++ Builder but VC++ says the lib file is corrupted.
[rant]Almost everything works in BCB and alomost nothing works in VC++. I cant use BCB because my company refuses to buy BCB[/rant]
I got a GPF when I tried explicit linking using the procedure name. How can I create a lib file for use with VC++ ?
Sahir
|
|
|
|
|
You could use the LoadLibrary function and get a pointer to the functions you need to call... its not as good as having the .lib but it solves the problem.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
|
|
|
|
|
I tried that. I was able to get the procedure address too. But when I tried to call the function I got an access violation. I even tried writing an intermediary DLL in Borland C++ Builder. When I call the intermediary DLL I still get an access violation. This must be why IBM recommends implicit linking. Is there some utility which will create a lib file from a DLL?
|
|
|
|
|
I want to use some compare string functions,so I find strcmp,wcscmp,_mbscmp .It seems that they are case sensetive.How can I manage them that they become case insensitive?For example there is no differenece between "Ma" and "ma" and all M and m be the same?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
_stricmp()
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks.Thats exactly what I want.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have a formview class and I want to catch press key events.I overriden KeyUp and KeyDown in it but it seems that they do not fired when I press keyboard keys.How can I catch press key in my form view class?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Those are the correct events. What keys are you trying to catch ? Maybe you need to catch them in your MainFrame ( I would not have thought so, but I can't really remember much MFC )
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Christian Graus wrote:
Maybe you need to catch them in your MainFrame
No,I want them in my View Class.
Christian Graus wrote:
What keys are you trying to catch ?
I want delete key,but I test them for all of my keys and they didn't fired.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
No,I want them in my View Class.
I'm sure you do. I want a million dollars. I am saying that I *think* you may have no choice but to catch them in your mainframe class. I could be wrong, but if I am right, I am saying you're stuck with it. You should probably wait until someone who is still lumbered with MFC can give you a better reply, because as I said, I have not been for some time.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Overriding ::PreTranslateMessage may help,
And I swallow a small raisin.
|
|
|
|
|
thanks.It works.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Does anyone know how to host the web browser control in an sdi app in the client rectangle using only straight com interfaces? I dont want to use htmlview
|
|
|
|