|
Paul Watson wrote:
But no file appears.
Try with absolute path name. The file is generated but you are looking at the wrong place.
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
Rama Krishna wrote:
Try with absolute path name. The file is generated but you are looking at the wrong place
I wish Rama. That was my first thought, so I tried c:\test.xml to no avail. I even checked in the DEBUG folder, then set the project to RELEASE and checked in that folder. Nix, nada, nothing. Even compiled the app and ran it out of the DEBUG environment. Nothing.
I even put in a FUBAR path (e.g. c:\sibling\kill\die!.][\\wicky\test.xml) and it still ran without generating an error. I would think it would throw an exception with a path like that.
Some further info: The app that runs is the c# app. It loads with a Windows Form and in the form_load it creates an instance of the class I coded in C++. It then calls a function in that class which contains the code which is supposed to write an XML file.
If I take that XML code, translate it to c# and put it in the c# app, then the XML file appears.
If I run the C++ class library on it's own and call that function, the XML file appears.
But as soon as I try and call the c++ class lib function from c#, the XML file does not appear. No errors either.
To me it seems as though the c++ class lib is not getting the neccesary rights to write a file. But then it should throw an exception surely?
*sigh* Be glad when this contest is over lol
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|
|
Maybe you forget an extra \. You should do: C:\\file.txt . Just guessing
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexpro wrote:
Maybe you forget an extra \. You should do: C:\\file.txt. Just guessing
Good idea, but alas, no luck.
Further info: I just moved the code out of the one function and into a function I know was working earlier. Lo and behold it starts returning exceptions. Errors I can deal with, it is when you get nothing that I get frustrated.
Maybe I should try this in normal C++ and leave MC++ alone.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|
|
Paul Watson wrote:
Maybe I should try this in normal C++ and leave MC++ alone.
Or return back to familiar terrotories.
C++ doesnot work for some people. It looks at the personality first and decides whether it should work for the person or not.;)
If possible mail me the code. This looks very weird problem.
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
Rama Krishna wrote:
Or return back to familiar terrotories.
C++ does not work for some people. It looks at the personality first and decides whether it should work for the person or not
Wave a read flag in front of my face why don't you!
That is tantamount to a challenge of the highest order. Now not only do I have to win that contest, but I have to do it well enough to impress Rama Programmer Guru Krishna, hehe.
Well I don't fully understand the problem yet, but I have got the code working by not using a bool and rather using a String* . I assume it has some managed types explanation behind it.
You can check it out when I submit my article
Thanks for the help.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|
|
Is it possible to assign a thread to a single processor in C++ with Visual studio ?
|
|
|
|
|
Check SetThreadAffinityMask. But better be sure what you're doing.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
If you are simply concerned that windows is optimizing your threads processing effectively, you should know that it runs all of your threads on different processors until it has to double up on a processor. So it tries to maximize the through put of the multi-processors parallel processing.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In MFC, how would you go about getting that PATH of the current executable - AfxGetAppName is not enough.
Help
|
|
|
|
|
__argv[0] should do the trick. It's global variable in MFC.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
__argv[0] will contain incomplete path when you launch the program from command line. Seems that most reliable way of getting the path will be ::GetModuleFileName.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Cheers. I had a feeling about GetModuleFileName, but thought it would only provide the filename again.
|
|
|
|
|
Giles wrote:
I had a feeling about GetModuleFileName, but thought it would only provide the filename again.
It'll give you complete path, including filename. If you want to have only directory part left, copy the filename into CString, then use CString::ReverseFind and CString::Left.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
GetModuleFileName(0,...)
includeh10
|
|
|
|
|
i need a dockable menu (that is: the menu can be move around and docked at top, left ... of main frame,
Help.....
seven flowers for u ...
includeh10
|
|
|
|
|
Hello everybody!
I tried to outsource some common classes from some existing projects into a shared static WIN32-library. The classes were implemented into a MFC dialog application and make use of MFC templates such as "CMap" and also of MIDL base_types like "hyper"...
The problem is: If I try to compile those classes within a static WIN32-lib workspace, Visual Studio mourns about that "hyper", "CMap", etc. are unknown (Error C2501). Although I've set the option that I want to use MFC in this library.
I think that I have to link some more headers or set some switches in the properties of the static lib workspace... But I found no suitable hints at the MSDN library at all!
So... Maybe someone can give me a tip how to implement "hyper", "CMap" & Co. into a static WIN32-library...??? *pls*
Many thanks in advance!
With best regards,
Andreas Dilling
|
|
|
|
|
Hello,
when i exit my application, i get this message from the debugger:
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
What is the meaning of this Warning?
Thanks for your Help!
|
|
|
|
|
This means that you're having problems with lifetime of your dialog. Is your dialog main window of your app?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
That msg occurs when you have a class instance that is being
destroyed before its window. The class destructor will
automatically destroy the window for you, but since this is
done from the destructor, the instance is no longer around
to handle any messages. This is sometimes the behavior you
want, just make sure that your destructor AND OnDestroy both
call a cleanup routine in common.
|
|
|
|
|
Hello Thomas and Scott,
Thank you very much for your help!
I have found the error:
I have a view, he create via new dialogs. When i exit the dialogs, in my OnDestroy-function of the view, i delete the dialog.
Now i delete the dialogs in the destructor of my view.
|
|
|
|
|
I've just started to read about this. seems like custom controls can have relected messages. so a regular old button added from the toolbox is not able to do reflection?
Thanks,
ns
|
|
|
|
|
anonymous wrote:
so a regular old button added from the toolbox is not able to do reflection?
All controls can use reflection.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
The article I was reading was adding handlers for messages starting with = via the classwizard. One selects the class of the control and then handles the = message. Since I added my button through CW I dont have a control class for it in my CW. Thats why I incorrectly deduced that standard controls couldnt refelect.
Thanks,
ns
|
|
|
|
|
Hi All !
One problem pursues me for a few years already:
all my Win32 apps, written in VC++ (5.0-6.0),
crash on the second run under debugger.
Toolbar code in comctl32.dll causes access violation.
In more details:
1)The crap arises only when the app
is run 2 times successively from the VC++ IDE.
When running my app standalone, all's ok.
2)The program crashes when a mouse is moved
over the toolbar. WM_MOUSEMOVE is finally
dispatched to DefWindowProc() in comctl32.dll,
and there fails.
The mouse coordinates seem to be correct.
3)If toolbar is hidden, it's allright.
4)This bug seems to be not accidental
concatenation of circumstances:
this happened on different Windows versions,
under both VC5 and VC6, after many reinstallations
of the VC++ and OS etc,
and, finally, with all my Win32 GUI apps -
independently of tyhe architecture of the app,
and of the way I use tollbars
(containing ReBar, different styles, etc.)
5) The bug arises and disappears from time to time,
during the course of program development.
It seems that it depends somehow
on the size of the .exe or something like that.
Anyone ever faced this problem ?
Any help or hint would be appreciated !
Thanks in advance !
|
|
|
|