|
I have a Visual Studio solution that contains an MFC executable project and a .NET C# class library project with a Windows Form. When I instantiate a simple C# Windows form from the MFC program, then, on closing out the form and exiting the MFC app, I receive an assert in the CCmdTarget destructor (line 48 cmdtarg.cpp) because m_dwRef is > 1. I have recreated this with the simplest MFC and C# windows from that I can make. I still get this assert. Other than the assert on close-out, everything else works fine. The form is instantiated from an MFC CDocument class object using the following code:
FormX *f = new FormX();
f->ShowDialog();
What's my problem??
|
|
|
|
|
RockyMu wrote:
FormX *f = new FormX();
Where are you deleting f?
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
Thanks, Anon. I was not deleting 'f' thinking that it would just get garbage-collected, but I can see the problem with that.
Since deleting 'f' requires a destructor, I have added the 'delete f;' code to the MFC object and a destructor '~FormX(){}' to the form's code. When I compile the MFC code, I get an C3841 error on the delete statement which says "C3841: illegal delete expression: managed type 'ClassLibrary1::FormX' does not have a destructor defined." I am still missing something?
Paul
|
|
|
|
|
RockyMu wrote:
I am still missing something?
Sorry man.... can't help you there. MFC->.NET interaction I haven't delved into.
No garbage collection in MFC to help you out with the new/delete operations. But I imagine that your problem is a result of your instantiation of the FormX object and MFC not knowing how to release it properly. At least it's a place for you to start looking.
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
I have a driver that provides low level access to the hardware, but it does
not function for all users. It only works when logged in as the
administrator.
How can I tell windows that the driver/program has priveledges to run the
driver to perform the low level functions (inp/outp)?
I am not a professional software writter, obviously, so if you could provide
a piece of code this would help.
I have tried several examples from codeguru and codeproject that were
suppose to allow this type of situation, but they do not work. No matter
what I try, I cannot get windows to let the driver run with priveledges in
non-administrator mode.
Many thanks for your help!!!!
Brad
|
|
|
|
|
If you create MFC7 applications using C++.NET, are the projects compatible with the 2002, 2003 and 2005 versions ?
It's just that we have a couple of copies of 2002 and I would like to make sure people can exchange files and projects (just for MFC).
Thanks.
Elaine
The tigress is here
|
|
|
|
|
Hi
I´m creating my own "MessageBox" -like class, derived from ::Form.
I want the messagebox to close when I press the "OK" button , i.e. to work as if the "x" (close)-button was pressed.
I don´t know where to find the code for this.
Can anyone help?
sincerely
doneirik
|
|
|
|
|
doneirik wrote:
I want the messagebox to close when I press the "OK" button
All messageboxes are like that...
Call
CDialog::OnOK(); on the click event of your OK Button..
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Hi,
I need to extract the text from a pdf file into a txt-file. I found I great library on softinterface.com but it's demo so I can't use it anymore
|
|
|
|
|
I have to run .ppt Presentation in the body of my project Diallog-window (or I need the CDC of the window which contains presentation).
Please tell me how can I do it.
Thank's in advance
|
|
|
|
|
Use ShellExecute(hWnd, "open", "MyPresentation.ppt", ...) .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to add a timer delay in a dialog based application in visual C++?
Usman Arif
|
|
|
|
|
See SetTimer() and KillTimer() to set a periodic low-resolution timer. To suspend execution, use Sleep() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Sir,
I have created an ATL composite control, and am putting it on multiple instances of a modeless dialog box. For each instance of the control I am calling its draw function with different parameters but the multiple instances all display with the same parameters. What is happening and how do I get around this problem.
Esteemed members please help.
Thanks
Deekonda Ramesh
|
|
|
|
|
I need some help on this ,will somebody look at my problem
Deekonda Ramesh
|
|
|
|
|
hello to all members
Can any one tell me
what is function or api to split the string
Thanks in advance
ankit
|
|
|
|
|
Use CString::Mid() to extract a substring from a CString .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ankit Aneja wrote:
what is function or api to split the string
What string?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a very trivial question, but I can't get it working.
How do I change the path for "stdafx.h"? I want to move my "stdafx.h" file to another directory, say "include/stdafx.h". But I get the "unexpected end of file while looking for precompiled header directive" error while compiling.
my precompiled header project settings:
use pch through file: include/stdafx.h
precompiled header file: $(IntDir)/$(TargetName).pch
How do I do this?
using: [VISUAL STUDIO .NET] [WINXP PRO SP2]
|
|
|
|
|
Hello ,
Please help me or give me some good information on microsoft communication control
version 6.0 .I need to use some of its functions .
Thanking you
Rohit Deshpande-
atotalgeek@gmail.com
|
|
|
|
|
Hi all,
i am developing simple application in VC6 that uses MS CryptoAPI.
One component of my application has login dialog which asks user for loginid,password. and i want to generate Public Key & private key pair for that user.( based on ids/password OR Randomly ) then onwards export publicc key to fixed location on remote server. And Other key will be in memory.
And when that user logs out of my application.... the private key will be lost.
How can i get same private key and public key pair next time when that user logs in.?
I have looked around this forum but not found this... Using MS cryptoapi can i get same keypairs on each login for same user? as far as i understood it is not. Am i right?
Then on i want to encrypt the message with public key of other users on system.
So that the other user can decrypt ( on remote machine ?) the message and read.
Thanks in advance.
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
Hi!
When I compile my program I met this error:
"d:\programming\microsoft visual studio\vc98\include\xlocale(467) : fatal error C1067: compiler limit : debug information module size exceeded"
Please help me!
Love
|
|
|
|
|
If you have not seen this before
from msdn
**********
compiler limit : debug information module size exceeded
This error could occur if a symbol has a decorated name exceeding 247 characters. Shorten the symbol name.
It could also mean that you have many symbols with long names or that a class, struct, or union has too many members.
|
|
|
|
|
Thank for your help. I've found the way to fix it. Because I declare many variable in one class.
Love
|
|
|
|
|
In the spirit of sharing information, how many member variables did this class have when the compiler error happened? How many did you have to remove?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|