|
Ignore that last message...tis not the answer your looking for...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It's declared in winuser.h
But winuser.h is declared in windows.h I think.
So open your winuser.h and search for GetWindowModuleFileName
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
|
To All: Thanks a lot! I solved it.
To Tomasz Sowinski: You are right! Thanks anyway!
|
|
|
|
|
Hi..
I'm not the greatest codewiz, but have managed to put together a DLL which given a window name can set that window to either modal or modeless.. This is fin except that I'd rather work with window handles.. Here's where I get a problem since the program I use to call the DLL can only pass a LPCSTR , but can convert a handle to this.. I now have to convert the LPCSTR to a HWND within my dll somwhow ?
If anyone have an idea I'd be very grateful
/Thomas
|
|
|
|
|
Why not change the parameters to HWND and avoid the whole typecast period...?
If it's a third party DLL passing it a HWND if it expects a LPCSTR is gona cause serious problems i'd think...
LPCSTR temp;
HWND hwnd = (HWND)temp;
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Ahhh...
Thank you very much.... I'll give it a try ASAP
/Thomas
|
|
|
|
|
Why does the caller have to use LPCSTR...?
One is a pointer to a string of char's and the other is a windows handle...the conversion should work and it should compile, but your app might act funny...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
The thing is that the calling application is made with a casetool called Cool:Gen and it is not very good at using OLE/ActiveX or other external functions..
So after I have made my DLL and try to call it Cool:Gen will only allow me to specify a text variable (LPCSTR) as output. Thus when passing a date that too wil have to be converted to an LPCSTR before making the call.
The casetool is point and click so I'm just presented with a list of available choices.
/Thomas
|
|
|
|
|
Ahhh!
I see...although I have never used a case tool I think I know what they are...
RAD utility...? Like VB but easier...?
Ok dokie...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Actually Cool:Gen is so restrictive that the only thing you type are descriptions and if necessary the contents of a hardcoded textstring..
All the rest is donew by clicking with the mouse and in theory it's impossible to make invalid code.. (works app. 95% of the time, if you are not trying anything to fancy like using OLE or ActiveX objects )
based on what ou just cliked on you are presented with a selection of valid arguments/variables you can use.. It's a rather complex tool containing both datamodelling, Database s tructure and documentation. Besides that it can generate both C, Cobol java and ASP/COM and several other languages to sevaral DBMS'es based on the same code you clicked in.. Very highlevel language..
Compared to it VB would be like assembler.. The price for this is that you are very limited in what your code can do..
BTW: I tried you code and I found that I had to use atol on my LPCSTR and then use HWND = (HWND) long .. But I wouldn't have made it without your help...
/Thomas
|
|
|
|
|
I'm trying to set up an application that uses MFC's CBitmapButton. I've managed to get them to work provided that the bitmaps are already present within the resources available to the application. What I would like to do is give the users the oppurtunity to customize the look of the app by allowing them to change the images that the CBitmapButtons use to one of their own images and have the change done at runtime. I've managed to load a bitmap from a file using the LoadImage() function, which returns a handle that can be casted into a HBITMAP. What I'm stuck on is how to take that HBITMAP and tie it into the CBitmapButton, . The CBitmapButton::LoadBitmaps member function takes only two types of paramaters a "LPCTSTR lpszBitmapResource" or a "UINT nIDBitmapResource". Is there a way to cast an HBITMAP or a CBitmap into a datatype that the CBitmapButton::LoadBitmaps function will take?
Thanks for you help.
|
|
|
|
|
LoadImage() function, which returns a handle that can be casted into a HBITMAP. What I'm stuck on is how to take that HBITMAP and tie it into the CBitmapButton
Something like the following:
HBITMAP hBit = LoadImage(...);
CBitmapButton* temp = CBitmap::FromHandle(hBit);
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Sorry but, couldn't get that code to compile in VC++ 6.0
HBITMAP hBit = LoadImage(...);
CBitmapButton* temp = CBitmap::FromHandle(hBit);
error C2440: '=' : cannot convert from 'class CBitmap *' to 'class CBitmapButton *'
Also I'm trying to take advantage of all four states of the CBitmapButton, up-state, focus-state, down-state, disabled-state.
|
|
|
|
|
hello,
i recently purchased visual c++ and some books and i need a little direction on where the best place to start is. it's pretty overwhelming.
i've spent the last couple years developing database driven web applications, but i need to take the next step now. are there any good sites besides this one? any peticular thing i should really focus on first?
sorry for the noobie questions, but i really want to learn.
thanks in advance for any advice.
-mike
|
|
|
|
|
IMO you aren't going to get a concrete answer. You wil get peoples opinions.
Mine personally....start with SDK understand that, then move into MFC. First and foremost learn C++ if you don't already know it.
I guess it depends on what your trying to accomplish...do you plan on making q & d type DB apps or really cool looking GUI's...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I would skip MFC unless you want a job programming MFC.
What kind of application would you like to create? Once you figure that out then ask what tools and languages you should learn to create those applications.
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
If you don't know C++ then I'd be starting out with C++ console apps, ignoring both the SDK and MFC. I'm sure others can recommend some good C++ books for beginners.
Michael
|
|
|
|
|
Hi,
I want to know the speed at which the data is transfered throught the network. Is there any fuction which returns the network speed.
Pls help...
Thanks
|
|
|
|
|
Is there anyway to know which lib to link when you get a linker error for unresolved errors
eg error LNK2001: unresolved external symbol __imp__ShellExecuteA@24
LNK1120: 1 unresolved externals
Which library do I need to link to for SHELLEXECUTE to work.
(I have to add it to a makefile )
---
|
|
|
|
|
shell32.lib
You can find information like that at msdn.microsoft.com.
|
|
|
|
|
I have a multiline edit control on a dialog and I disable it with EnableWindow(FALSE). My problem is that I want the text to be a different color but it stays the grayed out disabled color. I would be open to not disabling the box but that would give me three additional problems. a) I'd have to make sure it could never get focus, b) I'd have to change the mouse cursor from the I-beam to the arrow, and c) I'd have to make sure text couldn't be selected.
Any Suggestions are welcomed
-Jack
|
|
|
|
|
What about making it read-only.
I dont know why you wouldn't want someone to be able to select the text in the edit control, maybe they would want to copy that data to the clipboard for another app.
|
|
|
|
|
Read only still allows the textbox to have focus. Disabled does exactally what I want except for the text color.
-Jack
|
|
|
|
|
I've decided to do this by using a read only box. I handle the EN_SETFOCUS message to give focus to another control so this control can't have focus. What message do I have to handle to change the default mouse cursor?
-Jack
|
|
|
|