|
I just tried "Boy\\&&Girl" and I got "Boy\Girl".
Un
|
|
|
|
|
I do not know too,for I am a beginner. haha
Keep running slowly but never stop.
|
|
|
|
|
hi
I am getting error
Unhandled exception at 0x0037bbae in abc.exe: 0xC0000005: Access violation writing location 0x000000a8.
I debugged and it looks like the error happens at a function call.
argMainLoop( MouseEvent, keyEvent, mainLoop );
the three arguments are three functions.
declaration:
void argMainLoop( void (*mouseFunc)(int button, int state, int x, int y),
void (*keyFunc)(unsigned char key, int x, int y),
void (*mainFunc)(void) )
I check the disassembly.
argMainLoop( MouseEvent, keyEvent, mainLoop );
0043DE9F push offset mainLoop (43E410h)
0043DEA4 push offset keyEvent (43DF90h)
0043DEA9 push offset MouseEvent (43DF60h)
0043DEAE call @ILT+4420(_argMainLoop) (436149h)
0043DEB3 add esp,0Ch
the crash is happening at last two lines of the assembly.
The functions that are passed as parameters are all forward declared. all the declarations looked fine(else might have been compiler issue). the error is coming up in run time in debug and release configurations.
I am stuck here with no idea how to proceed in identifying the error. Any hints would be very helpful
|
|
|
|
|
How are declared and defined the callback functions?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the definitions seems to be fine.
static void MouseEvent( int a, int b, int c, int d);
static void keyEvent( unsigned char key, int x, int y);
static void mainLoop(void);
int main(int argc, char **argv)
{
glutInit(&argc, argv);
init();
arVideoCapStart();
argMainLoop( MouseEvent, keyEvent, mainLoop );
return (0);
}
static void MouseEvent( int a, int b, int c, int d)
{
}
static void keyEvent( unsigned char key, int x, int y)
{
char message[100];
if( key == 0x1b ) {
printf("*** %f (frame/sec)\n", (double)count/arUtilTimer());
cleanup();
exit(0);
}
if( key == 'c' ) {
printf("*** %f (frame/sec)\n", (double)count/arUtilTimer());
count = 0;
if( mode ) printf("Continuous mode: Using arGetTransMatCont.\n");
else printf("One shot mode: Using arGetTransMat.\n");
}
if(key =='r'|| key =='R')
{
out<<"***";
std::cin>>message;
out<<message<<std::endl;
for(int j=0; j<3; j++)
for(int k=0; k<3; k++)
rot[j][k] = model[j][k];
arGetAngle(rot, &rx, &ry, &rz);
tx =model[0][3];
ty =model[1][3];
tz = model[2][3];
out<<tx<<" "<<ty<<" "<<tz<<" "<<rx<<" "<<ry<<" "<<rz<<std::endl;
}
}
static void mainLoop(void)
{
static int contF = 0;
ARUint8 *dataPtr;
ARToolKitPlus::ARMarkerInfo *marker_info;
int marker_num;
int j, k;
if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) {
arUtilSleep(2);
return;
}
if( count == 0 ) arUtilTimerReset();
count++;
argDrawMode2D();
argDispImage( dataPtr, 0,0 );
int markerId = tracker->calc(dataPtr,-1,true, &marker_info);
float conf = (float)tracker->getConfidence();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glLoadMatrixf(tracker->getModelViewMatrix());
printf("\n\nFound marker %d (confidence %d%%)\n\nPose-Matrix:\n ", markerId, (int(conf*100.0f)));
for(int i=0; i<16; i++)
printf("%.2f %s", tracker->getModelViewMatrix()[i], (i%4==3)?"\n " : "");
tracker->getARMatrix(model);
contF = 1;
argSwapBuffers();
}
|
|
|
|
|
There's probably a stack overflow happening in one of the functions.
Try commenting out all code in the functions that are passed as parameter to argMainLoop.
Do you really need local scope (static) for the functions?
My advice is to typedef the function pointers.
It would be more neat.
Example,
typedef void (*MOUSE_EVENT)( int a, int b, int c, int d);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hello :]
I have a problem with my dialog(s) and I did some screens in order to explaine easier where I am stucked.
Since english is not my language, please accept appologies in advance, if I may sound a little bit unclear.
I have made the following dialog:
http://i213.photobucket.com/albums/cc181/ves604/komp/01.jpg
which as you see, has more than one part. On the left side is list-menu, where user can choose one of 4 options, that
will show on the right side, in the place of child dialog. That child dialog is attached to the main one (the parent),
each time when I call one of those 4 options, I have to do that. We have written funstion "AttachChildDlg", and also, "DetachChildDlg"
that does the opposite: when I want to get from ie first child (that is first option) to third child (third option in menu), I have to
detach the first one, and after, attach the third one as new one. That is doing very well.
the problem gets with this: when I have this, first child, which contains another child dialog in itself (that list with some data),
and if from that one, I call another dialog by pressing some button, and then from that one another dialog, do something there, return with OK to previous,
then from that one - return again to previous (the original one) - what I get then is that my child dialog inside the first child - has dissapeared.
I know this might sound lot difficult, so I am giving these screenshots, as photo can speak instead of thousand words
when I click on that dialog, on red-circled button, I open another dialog,
http://i213.photobucket.com/albums/cc181/ves604/komp/02.jpg
then I mark something on right side, and open another dialog,
http://i213.photobucket.com/albums/cc181/ves604/komp/03.jpg
now, if I return with OK to previous, and then again to very first one, I get this:
http://i213.photobucket.com/albums/cc181/ves604/komp/04.jpg
soo..if anybody has any idea what might gone wrong, please write it. I can post you part of code of course.
Maybe there is something in dialog properties that I didn't use properly, but I tried so many combinations..
thank you
I am working in Visual Studio 2005, C++
|
|
|
|
|
andrassy wrote: On the left side is list-menu, where user can choose one of 4 options...
I see 5. I doubt that matters, however.
andrassy wrote: ...when I want to get from ie first child (that is first option) to third child (third option in menu), I have to
detach the first one, and after, attach the third one as new one. That is doing very well.
But it's way too complicated. Why not just have a property sheet with four (or five) property pages? Your problems will likely 'disappear' after that.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Is the list of "Field Device Properties" a child dialog or some sort of custom control?
If its a control, I'm guessing it is a painting problem.
You should try to invalidate or repaint the control after the child dialog is dismissed.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: Is the list of "Field Device Properties" a child dialog or some sort of custom control?
If its a control, I'm guessing it is a painting problem.
You should try to invalidate or repaint the control after the child dialog is dismissed
yes, Field Device Properties is child indeed - so we have child in child situation. the thing is, not the whole child dialog dissapears, but only list control in int. see these pics:
http://i213.photobucket.com/albums/cc181/ves604/komp/01-1.jpg
http://i213.photobucket.com/albums/cc181/ves604/komp/04.jpg
DavidCrow wrote:
But it's way too complicated. Why not just have a property sheet with four (or five) property pages? Your problems will likely 'disappear' after that.
yes, 5 options, just a writing mistake
I am sorry but I do not understand what is property sheet with n pages?
I had to do this with picture control: it was needed for child position, so when it attaches, it sets on pict. control position. At least, collegue had done that way on some other dialog in our programme, do you have idea for something different?
|
|
|
|
|
I solved the problem; it was something real stupid: that picture control, that I used to place child dlg on parent dlg, was set to be visible - it occured to me that is should be put as "not visible" - and all is all right now.
thank you all on topic for help.
|
|
|
|
|
Hi All,
I had a general query regarding modal dialogs and child windows.
Is there any way by which I can restrict a CDialog instance to be
within the client area of a parent window and yet also allow DoModal method
to work correctly ?
From what i`ve seen so far, such dialogs show the CWnd value passed to them
in the constructor as the parent/owner in Spy++ but can still be moved out of it when
the modal loop starts.
Doing a SetParent causes both the parent and dialog to hang when i call DoModal.
Thanks in Advance.
|
|
|
|
|
Hello,
Change the style of the dialog as "Child" from the property window and now try.
but DoModal won't work fine I think because when you do "DoModal()". the parent window being disabled thus the all of it's child windows will be disabled and you will not be able to operate anything within the new window you're showing. But the dialog will be restricted inside the parent's client area. Why you can't use Modeless dialog?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hi Sarath,
Ur absolutely right, thats the first thing i tried and it completely hangs the entire application UI itslef
|
|
|
|
|
TyrionTheImp wrote: Is there any way by which I can restrict a CDialog instance to be
within the client area of a parent window and yet also allow DoModal method
to work correctly ?
Something like this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi David,
That sample looks interesting....i`ll try tweaking the GetOwner and SetParent part right now
|
|
|
|
|
Hey Guys,
Thanks to David`s sample I found a "fix" for this issue...
u need to set the owner in the initdialog function and also manage
the visibility state urself. This, along with the code to restrict
the dialog`s movements makes it feel as though its an actual child window
and also keeps DoModal working.
Thanks to all for the help.
Appreciate it I do.
|
|
|
|
|
Hi,
I'm trying to use the 'inet_addr' function to convert a char IP address, but I think since the IP Address i'm passing in to the 'inet_addr' function has leading zero's (192.169.055.075), the 'inet_addr' function is interpreting this differently. Any suggestion on how to remove the leading zeros?
Thanks
char IPAddr[20]; //192.169.055.075
ulAddr = inet_addr(IPAddr);
|
|
|
|
|
JBAK_CP wrote: Hi,
I'm trying to use the 'inet_addr' function to convert a char IP address, but I think since the IP Address i'm passing in to the 'inet_addr' function has leading zero's (192.169.055.075), the 'inet_addr' function is interpreting this differently.
Indeed, according to documentation, numbers with a leading zero are parsed as octal.
Provided your format is fixed (as it looks) you may use
int a[4];
char c[20];
if ( sscanf("192.169.055.075","%03d.%03d.%03d.%03d", a, a+1,a+2,a+3) == 4)
{
sprintf(c, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]);
}
eventually c[] contains the address without leading zeros.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks!
|
|
|
|
|
It would be greatly appreciated if anyone could point me towards a good serial communication class and demo running in a thread. I've found quite a few but none are fitting my needs.
Thanks!
|
|
|
|
|
What about this one[^]? Or this one[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Have you had a look at CP articles [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
This is again related to the Listboxes in VC++ MFC. I have a listbox containing the list of parameter names which are retrived from a text file say XXX.txt.In this XXX.txt,the values are stored in the format as given bellow.
Parameter No1.
Parameter Name1.
Parameter Value1.
Parameter No2.
Parameter Name2.
Parameter Value2....and so on...
So for example it is as:
1
abc
ee34
2
rtrt
ff45
.
.
.
and so on..
So now among these values,all the parameter names are listed in the particular listbox. Now using this listbox,if I double click on the a particular parameter name among the list listed in the listbox,that parameter name must be retrived from the listbox along with its parameter number and its parameter value which are available in XXX.txt text file and should get stored in another text file say YYY.txt.Similarly I must be able to do multiple selection of parameter names from the listbox and store all of them along with their parameter number and parameter value at once in YYY.txt.
Can anyone suggest me how to go about the above problem.
|
|
|
|
|