|
Ok thats great thanks. I wouldn't have been able to see my strings. But no strings are still showing This is my code to add a string to the list -
char TestString[] = TEXT("Test");
SendDlgItemMessage(hWnd, IDC_ADAPTER, CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)&TestString);
There must be something wrong with this - any ideas.
Thanks again
Zak
|
|
|
|
|
Zak_ wrote:
char TestString[] = TEXT("Test");
SendDlgItemMessage(hWnd, IDC_ADAPTER, CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)&TestString);
There must be something wrong with this - any ideas.
Try it like this:
SendDlgItemMessage(hWnd, IDC_ADAPTER, CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)TestString);
Your code adds a pointer to a pointer to a 0-terminated string.
- Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Hello,
I don't like wizards, so I decided to things on my own. I set up a project with a formview. I didn't do anything out of the ordinary, but the CWnd::Create() method just won't be called!
Can anyone please tell me where that method is called and what I have to do for that?
thanks
|
|
|
|
|
Give us the details, pal, and we'll be glad to help you. Why don't you post (part of) your code?
HINT: Check the return value of Create() and see if it returns 0 - if it does, something's terribly wrong.
Hope this helps (give the code, though) ,
Vikram.
-----------------------------
My site due for a massive update.
"Good lord you yanks are getting worse than a defensive VB developer at a C++ conference." - Paul Watson in the Lounge, 31 May 2003.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Hi,
I just don't know where to call Create(), I can't even find it in the wizards generated code!
regards,
|
|
|
|
|
iumentum wrote:
I just don't know where to call Create()
You should do it typically (but not always) from OnCreate() in the class that you derive from CWnd or CFrameWnd .
iumentum wrote:
I can't even find it in the wizards generated code
AFAIK, the wizard has no use for this. You'll have to enter it manually. Don't forget to check the return value.
TIP: Get MSDN, and a good book. I'd recommend "Programming Windows with MFC" by Jeff Prosise.
Vikram.
-----------------------------
My site due for a massive update.
"Good lord you yanks are getting worse than a defensive VB developer at a C++ conference." - Paul Watson in the Lounge, 31 May 2003.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
What is the necessary style the a list box must have to display characters such as this correctly: å, ä, ö, Å, Ä
Or is it just a matter of Windows regional settings?
|
|
|
|
|
I think the only requirement is that you set its font to one that's capable of displaying these chars. Arial seems like a good bet, but I suspect Tahoma (the now-standard Microsoft font) would also work.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I want a button to be drawn fully red, do i need to create my own button class ? Owner-draw button is the way to go ? If so, can you point me too any good article that talks about it ?
Thanks
|
|
|
|
|
One solution is ownerdraw via WM_CTLCOLOR.
Kuphryn
|
|
|
|
|
You can also take a look here in CP at the Button articles in order to find out some classes already done... CButton ST is a good class...
HTH...
|
|
|
|
|
Hi,
I have a VC++ application that launches another application in Run Time
<br />
char* pszFileName = "c:\\NewApplication.exe";<br />
spawnl( _P_NOWAIT, pszFileName, pszFileName,NULL);<br />
It works fine, but I could not find another command to terminate that application (NewApplication.exe) in Run Time
Anyone can help me?
Thanks
|
|
|
|
|
Use TerminateProcess(HANDLE hProcess,UINT uExitCode);
|
|
|
|
|
skaanji wrote:
Use TerminateProcess(HANDLE hProcess,UINT uExitCode);
No, No, No, No, No, unless you want the user to loose all the work they've done.
To quote the MS Docs:
The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances.
Please be very carefull about what you you suggest to people here.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
I am trying & still find the way to do right!
Thanks
ATC
|
|
|
|
|
Hi,
I am working on it & still find the way to do right!
Thanks
ATC
|
|
|
|
|
|
Hi,
I am working on it & still find the way to do right!
Thanks
ATC
|
|
|
|
|
Obtain the handle of the window. Pass a message to it to shut down.
If it's an app that requires saving before closing then it should ask
Example:
HWND hWnd;<br />
LRESULT lpResult;<br />
<br />
hWnd = FindWindow(NULL, winName);<br />
if (hWnd == NULL)<br />
{<br />
return 0;<br />
}<br />
lpResult = DefWindowProc(hWnd, WM_SYSCOMMAND, SC_CLOSE, NULL);<br />
Hope this helps
|
|
|
|
|
Hi,
I did try your suggestion, but when I compiled I had two errors:
---> hWnd = FindWindow(NULL, winName);
---> lpResult = DefWindowProc(hWnd, WM_SYSCOMMAND, SC_CLOSE, NULL);
error C2440: '=' : cannot convert from 'class CWnd *' to 'struct HWND__ *'
error C2660: 'DefWindowProcA' : function does not take 4 parameters
Do you know why?
Thanks for help
ATC
|
|
|
|
|
In Java, they got rid of the use of pointers, and most Java
programmers will tell you because the creators want to get
rid of the pointers headache for programmers. I wonder if it
is true? Is pointers a headache for you? And is it useful? If
you don't use pointers, what alternatives do you have?
(off topic) By the way, do you happen to know if there is a
Java forum that is similar to this site?
Thanks.
|
|
|
|
|
VW_Red_Jetta wrote:
By the way, do you happen to know if there is a
Java forum that is similar to this site?
Try the JDC Forums: http://forum.java.sun.com/[^]
- Mike
|
|
|
|
|
other people's use of pointers is evil, but pointers are wonderful.
To vote with no response is to follow the way of the coward.
|
|
|
|
|
Chris Losinger wrote:
other people's use of pointers is evil, but pointers are wonderful
I agree, I dont do c++ but do c, and once you grasp that everything is really just a number and passing-by-reference is complete bollocks, then it all makes sense to you.
<a TITLE="See my user info" href=http:
|
|
|
|
|
VW_Red_Jetta wrote:
Is pointers a headache for you? And is it useful? If
you don't use pointers, what alternatives do you have?
No.
Yes.
VB
Java people say that pointers are evil. C++ people say that not controlling when object destructors run is evil. *shrug*
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|