|
What MFC stuff? I defined two static structs, called the Win32 SDK function ::GetDlgItem to fill the hwnd struct and then called the Win32 SDK function ::SendMessage to send the CB_ADDSTRING message. The only MFC you see here is the call to GetSafeHwnd becuase I don't know from where you're calling the ::GetDlgItem function. You can obviously replace that with however you get the hwnd for your dialog.
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Oh, sorry, i see, we're doing exactly the same... does your work?
|
|
|
|
|
No problem. My app is an MFC app, but I'm using Win32 SDK calls to mimic your environment. Yes, the data shows up exactly as it should.
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Then i simply don't understand it. I have also tried just passing (LPARAM)"hello" to the lparam, and nothing happens...
|
|
|
|
|
strange, when i use the CB_GETCOUNT message to get the number of items in the combobox, it says 147, but nothing shows up in the box...
|
|
|
|
|
When i send the WM_SETTEXT message and pass for example "Rock" to the lparam, it selects it and it appears...
|
|
|
|
|
I just checked if my WndProc recieved the CBN_DROPDOWN message (the message sent when the list is about to be expanden ie. dropped down) and it doesen't get the message...
|
|
|
|
|
What happens when you do a CB_SETCURSEL?
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
It works "Acid Punk"... number 3...
|
|
|
|
|
This tells me that your drop down is too small.
Sorry. I just read how that can be taken.
Anyway, this thread should help you in determing how to, er, lengthen your drop down.
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Tom Archer wrote:
What MFC stuff?
LOL
I can imagine how you just stood there stunned.
I mean you type in a post, two pages long and then he says this
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
He's probably used to getting MFC replies even though he's requested a Win32 solution.
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Tom Archer wrote:
He's probably used to getting MFC replies even though he's requested a Win32 solution.
Yeah
Possible.
Of course maybe he remembers how a guy here asked a CString question and suddenly another *guy* asks him if he is using MFC
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
This has nothing to do with answering your question, but you might find this link helpful!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Anonymous wrote:
WHat am i doing wrong?
I don't know. But here are some things to check:- If it is not already,
gszGenres should be defined something like this:
const char* gszGenres[] =
{
"Rock",
"Heavy Metal",
"Ancient ('70s) Rock",
"Fake ('80s) Rock",
"Industrial",
"Trance",
"Trip Hop",
"Rap",
"Baroque",
"Blues",
"Pop"
};
const int nNumGenres = sizeof(gszGenres)/sizeof(char*); - If there are really 148 strings in
gszGenres , then this loop will skip one, since it only loops 147 times (i = 0 to 146). If you use the code above, you can use nNumGenres to avoid hard-coding this value. - How is
DlgItems defined? Can you avoid hard-coding indices somehow? - Are you positive
DlgItems[5] is the correct HWND ? Put in a breakpoint and check.
--------
People they come together
People they fall apart.
No one can stop us now
'cause we are all made of stars... -- Moby, We are all made of stars
|
|
|
|
|
How to change screen resolution programmatically
(instead of 'Display properties->Settings')? Ha?
10X Yoll!
--BlackSmith--
"With the help of all mighty", 2002, Me.
|
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I loaded a bitmap by CBitmap object.
Can you tell me, how can i rotate it ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Have you checked GDI part in CP?I remember something like this could find in some articles.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Sorry, yes.
I must look at to MSDN better,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
Hey guys,
I'm writing a windows interface for a DOS program, which needs to trap the output and send keyboard input to the DOS program. I've tried CreateProcess and rerouting stdin and stdout, but to no avail. I think they've coded the DOS interface using direct BIOS calls or writing to screen memory. Is there any way to trap screen output that has been coded in this way? The other problem is sending keypresses to the program - stdin isn't working either.
Any clues would be greatly appreciated.
Cheers,
Paul
|
|
|
|
|
I have a dll project in visual c++
and I want to have a variable which will change by different exe files which use this dll.
for example if i have
"int i=0; //global var of the dll file
.....
int func
{
if (....)
i++;
}
"
I would like i to be 1 for the next time func is called by a differet exe file.
thanks,
Aviv.
avivhal
|
|
|
|
|
You need to put your data that will be shared across multiple invocations of the DLL into a shared memory segment. For example, the following declares a static variable (connections) in a shared data segment called .SHARDAT
#pragma data_seg(".SHARDAT")
static int connections = 0;
#pragma data_seg()
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|