|
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.
|
|
|
|
|
And what is your doubt about?
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]
|
|
|
|
|
You should associate the number and value to the name when populating the list box.
Here's how you can do it.
Create a structure having one member for number and another for name.
When reading the first name, create an instance of the structure and initialize its members.
For example when "abc" is read, the created structure instance will contain "1" and "ee34".
Use the CListBox::SetItemDataPtr to associate the structure instance to the index where "abc" is inserted.
To retrieve it you would then use CListBox::GetItemDataPtr to get an instance of the structure.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I'm just going to take a stab in the dark here and hope someone has some information about this.
We need to move our development environment inside of Citrix. Unfortunately we are still using Visual Studio 5.0, and haven't been able to upgrade due to compatability issues with third party software we are using.
I cannot get our project to build inside of Citrix. I get an "Error executing Link.exe", with no other errors at all. The first thing it's trying to build is a static library, and I can see that it creates all of the .obj files, but apparently never creates the .lib and then the Link.exe error occurs.
Just to eliminate the possibility that my large project can't find something it needs, I created a new "Test" workspace, created a new static library with just some comments in it and built, and outside of Citrix it builds fine, but inside Citrix I get these results:
Compiling...
Test1.cpp
Creating library...
Error executing link.exe.
Lib Test.lib - 1 error(s), 0 warning(s)
Then I tried a new .exe, just accepted all the Wizard defaults and tried to build, and also get the same type of error in Citrix:
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
ChildFrm.cpp
MainFrm.cpp
TestMFCApp.cpp
TestMFCAppDoc.cpp
TestMFCAppView.cpp
Generating Code...
Linking...
Error executing link.exe.
TestMFCApp.exe - 1 error(s), 0 warning(s)
So it kind of appears that I'm unable to build anything inside of Citrix. I thought it could be a permissions issue, but I now have Admin rights and am still getting the same error.
So I have a feeling there may be a compatibility issue with our old version of Visual Studio in Citrix, and unfortunately Microsoft doesn't support 5.0 anymore, so I'm afraid we may be in a bit of a bind. (I.e., my development may come to a screeching halt when they move all of our servers next weekend).
If anyone has any information about this and/or knows of any potential workaround to try, I would be most grateful.
Thanks in Advance.
|
|
|
|
|
AmVal wrote: We need to move our development environment inside of Citrix
'need'? Is that because your IT department/management have told you that you have to? If so, not being able to update a (mission-critical?) app is probably good leverage for keeping your current development setup
It appears that your problems are with linking - is it possible to see if a later linker works a) under Citrix, and b) with VC5?
AmVal wrote: haven't been able to upgrade due to compatability issues with third party software we are using
Is there maybe a workaround for those issues?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The reason we 'need' to move to Citrix is that when our app runs it connects to various databases, and all of our database servers are being moved across the country (instead of being housed in the same building where I work). So... outside of Citrix, I'd still be able to write and build code, but to do any sort of debugging or just running the app to see if things are working would be painfully slow. So, it seems like for perfomance reasons, we're almost going to need everything to be in Citrix.
We've asked about potentially keeping a test server here with some fake copy of the databases we're using, just enough for us to be able to run with... But were told flat out "NO".
So... How would I go about trying a later linker? Thank you.
|
|
|
|
|