|
I implemented working thread ..
UINT CRTFinalDlg::run(LPVOID p)
{
CRTFinalDlg * me = (CRTFinalDlg *)p;
me->run();
return 0;
}
In that working thread (run) I am using UpdateData functions ... and the program compiles prefectly, but when I'm starting it I'm getting ::
Debug Assertion Failure!
File: wincore.cpp
Line: 884
Pressing on ignore button repeats the Assert but in the background I can see that aplication runs well.
So, the question is :: what should I write instead of UpdateData(T/F)???
Just to say that application is Dialog based (so it has only one window)!
|
|
|
|
|
instead of using UpdateData(), you can send a user defined message back. Then in your dialog, in WindowProc, process your message by calling UpdateData().
|
|
|
|
|
You Cannot make a call to UpdateData from the Worker thread!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I have a problem with combo box in VS.net , i have a simple combo box (DropList) and when the user clicks it it only shows one item per row,in order to select other items user has to click on the little scrollbars that appear next to item.
I want simply that it showed all 6 items.But can't do it.
Can anyone help?
Regards
m0n0
|
|
|
|
|
I think it is to resolve at design stage where you can set the dimensions of a combo up. Drag the size handle of the combo more down on your dialog or view.
|
|
|
|
|
problem is i can't resize it verticaly.I can only resize it horizontally
m0n0
|
|
|
|
|
Try to delete it and create new one, resizing at once to desired size. I suspect it is a bug in resource editor. I experienced the same.
|
|
|
|
|
Nope. it does not help.I don't understand what's the problem
i can resize it vertically only if it's type in properties is set to "Simple" , but thats not what i need i need "DropList" style
m0n0
|
|
|
|
|
Go to the resource view and click on the dropdown button of the combo box. You can resize it vertically.
|
|
|
|
|
I have a modeless dialog, when one of its button is pressed, I called a subroutine to load a file. Since the operation is lengthy, I want to give user some feedback that sth is going on. So I want to show a text string. I did the following:
<quote>
CStatic textProgress;
textProgress.Create(_T("Image loading..."), WS_CHILD | WS_VISIBLE|SS_CENTER,
CRect(CPoint(rectDlg.left+nOffset, rectDlg.CenterPoint().y-2*nOffset),
CSize(rectDlg.Width()-2*nOffset, nOffset)),
pParent);
but when the system runs, I saw the rectangle at the position specified, but no text. why?
Thanks for any help!
|
|
|
|
|
Try this instead of pParent.
Haakon S.
A sure cure for seasickness is to sit under a tree.
Spike Milligan
|
|
|
|
|
I don't have access to "this", since it's not a member function, but a global function.
I also have a CProgressCtrl in this global function, it's being showed ok.
|
|
|
|
|
Did you try updating the static control?
Is this static control in another thread? If not then it needs to be repainted to show the text. like: mystatic.RedrawWindow() etc.
this is this.
|
|
|
|
|
great! RedrawWindow() showed my text.
Thanks a lot!
|
|
|
|
|
Running my program in debug mode I get the following three lines at the end of the output window:
The thread 0xFFEA33E3 has exited with code -1 (0xFFFFFFFF).<br />
The thread 0xFFEA76CF has exited with code 0 (0x0).<br />
The program 'D:\Prosjekter\MyProg\MyProg\Debug\MyProg.exe' has exited with code 0 (0x0).
So, what do I make of this? The last two codes indicates a succesfull run, but not the first. I just can't find out what it means.
Regards, Haakon.
A sure cure for seasickness is to sit under a tree.
Spike Milligan
|
|
|
|
|
Did you create thread 0xFFEA33E3? If so, then you should be able to control its exit code.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
No, I didn't. My program is single threaded. I guess one of the threads has to do with the debug routines.
Regards, Haakon.
A sure cure for seasickness is to sit under a tree.
Spike Milligan
|
|
|
|
|
Sometimes threads also come and go if you use some of the common dialogs, such as the file open dialog (CFileDialog). IF it was not a thread you created, you usually don't have to worry about it.
|
|
|
|
|
This may seem like a stupid question, but i simply don't know where to look. How can I execute a console program from another console program and catch the output so i can display it in my own program. Thing is I want to have a file compiled but i want to catch the output from the compiler binary in case of errors. The only functions I know to execute something are system() and ShellExecute() but I don't know how to catch the output after that.
Kuniva
--------------------------------------------
|
|
|
|
|
|
Kuniva wrote:
How can I execute a console program from another console program and catch the output so i can display it in my own program.
You can read here and here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have the following two functions:
unsigned PullTerminalId(unsigned long id)
{
return ((unsigned)(id >> 20));
}
unsigned long get_human_check_id(unsigned long id)
{
unsigned long terminalId = (unsigned long)PullTerminalId(id) * 10000;
unsigned long checkNbr = (unsigned)(id & 0xFFFF);
return terminalId + checkNbr;
}
As an example, if I call get_human_check_id with a value of 1048577, then the result is 10001
Could someone show me how to reverse this process?
|
|
|
|
|
i'm not sure you can.
one major problem is that the algorithm doesn't preserve all of the information in the original id. it looks like at least 4 bits of the original data are thrown away completely: in effect, the ">> 20" throws away 20 bits, but the "& 0xffff" recovers 16 of them - the final number is still missing the information that was contained in bits 16..19.
that's before you even look at the arithmetic...
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
[Tom Archer]
I think I got it. First, the 4 missing bits are not used in the system, which is why he's not accounting for them. Now that we know that the following function should work (I think)
unsigned long get_human_check_id_rev(unsigned long id)
{
unsigned long rev1 = id / 10000;
rev1 = rev1 << 20;
unsigned long rev2 = (unsigned)(id & 0x01);
return rev1 + rev2;
}
|
|
|
|
|
i'm not sure that's gonna do it either.
in the encoding, the information in the high 12 bits is combined with the low 16 bits through addition. seperating them is equivalent to finding which two numbers were added to produce "1234".
just for a test:
<br />
UINT in = 0xffffffff;<br />
TRACE("%in: s\n", BinDump((BYTE *)&in, 4));<br />
UINT hid = get_human_check_id(in);<br />
UINT out = get_human_check_id_rev(hid);<br />
TRACE("out: %s\n", BinDump((BYTE *)&out, 4));<br />
<br />
outputs:<br />
in: 11111111 11111111 11111111 11111111 <br />
out: 00000001 00000000 01010000 00000000 <br />
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|