|
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 !
|
|
|
|
|
I was wondering what are the principles of creating a plugin extendable program.
I mean a program that accepts custom functions being created by third party developer, following certain rules.
Like Winamp, or Windows Media Player, that with plus has the Speaker Enanchement pluging: you install the plugin and there is a new Item in the Windows Media menu.
Is there any tutorial, guide, etc about this?
Thank you.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
|
for the plugin system i use, i simply came up with a COM interface for the plugins and just told people that if they want to write a plugin for my apps they must: create an ATL object with this interface, name the object thusly, and place it in this folder.
at runtime, my app scans that folder and finds all the DLLs there. then it does a CreateObject call on each of "%DLLNAME.MyInterfaceName" . if that works, the object is a plugin.
it works great.
i can elaborate, if you'd like
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|