|
|
|
|
Try something like this:
HTREEITEM selectedItem;
int index=0;
while( GetParentItem(selectedItem)!=NULL )
{
selectedItem = GetParectItem(selectedItem);
index++;
}
I'm not quite sure what you mean by index so that might not be what you want.
There's always one more bug.
|
|
|
|
|
I am running an application on ShellExecute and I need to see its stderr output. how can I do that?
thanks
|
|
|
|
|
Try using CreateProcess.
Concussus surgo.
When struck I rise.
|
|
|
|
|
thanks.
now the problem is that I am using mfc dialog-based window and the stdin is not working (GetStdHandle(STD_INPUT_HANDLE) return 0), I think that why when I try to read from the pipe it is giving me the replay that the pipe is broken, same code in a console base project works fine,
any idea how to fix it?
Eliad.
|
|
|
|
|
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
|
|
|
|