Visual C++ .NET problem

S

Seko

Hi!

This is my first post here, so I don't know if this the correct place to
ask, but I have a problem with Visual C++:

I can't show neither a modal, nor a modeless dialog in a Windows Forms
Application, because of a Debug Assertion Failure in afxwin1.inl, line 26.

I don't know where the problem could be, because I don't do anything fancy
in the creation process.
(add a dialog resource, add a class for it, and then execute this code on a
click event: CMyDialog mydialog; mydialog.DoModal();)

I've searched Google, and lots of C++ sites for an EXAMPLE on how to show
dialogs in Forms Applications (.NET), but found none.

If anyone could point me to a site where there's a solution for this, or
better, give me a working example about using dialogs in a .NET Forms
Application, it would GREATLY be appreciated!

I go nuts about this, a simple dialog not showing.... In an MFC app.,
absolutely no problems!


Thank you very much in advance!
 
I

Ioannis Vranos

Seko said:
Hi!

This is my first post here, so I don't know if this the correct place to
ask, but I have a problem with Visual C++:

I can't show neither a modal, nor a modeless dialog in a Windows Forms
Application, because of a Debug Assertion Failure in afxwin1.inl, line 26.

I don't know where the problem could be, because I don't do anything fancy
in the creation process.
(add a dialog resource, add a class for it, and then execute this code on a
click event: CMyDialog mydialog; mydialog.DoModal();)

I've searched Google, and lots of C++ sites for an EXAMPLE on how to show
dialogs in Forms Applications (.NET), but found none.

If anyone could point me to a site where there's a solution for this, or
better, give me a working example about using dialogs in a .NET Forms
Application, it would GREATLY be appreciated!

I go nuts about this, a simple dialog not showing.... In an MFC app.,
absolutely no problems!


Thank you very much in advance!



Ask in microsoft.public.dotnet.languages.vc.


If it doesn't appear in your news server use the public MS one:

msnews.microsoft.com
 
M

Mike Wahler

Seko said:
Hi!

This is my first post here, so I don't know if this the correct place to
ask,


It's not. The topic here is the language, not any particular
compiler.
but I have a problem with Visual C++:

I can't show neither a modal, nor a modeless dialog in a Windows Forms
Application, because of a Debug Assertion Failure in afxwin1.inl, line 26.

This is neither a language issue nor a compiler issue, but a
Windows API issue. (Well I suppose it could be a language
abuse issue, but I cannot say without seeing the code ---
but please don't post it here -- we only deal with standard
code. That is, C++ has no concept of 'dialogs', 'forms', etc.
I don't know where the problem could be, because I don't do anything fancy
in the creation process.
(add a dialog resource, add a class for it, and then execute this code on a
click event: CMyDialog mydialog; mydialog.DoModal();)

I've searched Google, and lots of C++ sites for an EXAMPLE on how to show
dialogs in Forms Applications (.NET), but found none.

If I were you, I'd go to the authoritative source: Microsoft.
Search on www.msdn.microsoft.com
(also note that this site lists several newsgroups which discuss
Microsoft products and technologies.
If anyone could point me to a site where there's a solution for this, or
better, give me a working example about using dialogs in a .NET Forms
Application, it would GREATLY be appreciated!

I don't know if it has an example program, but the MDSN site
will show you the correct way to do what you're asking about.

-Mike
 
S

Seko

Thank you for the replies, apparently the situation changed somewhat, as now
I can successfully run the application with the dialogs - but only with
debugging disabled (release mode).

I will browse through MSDN, and try the newsgroup you mentioned.

Thank you!

-David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top