|
My code caused an _CrtIsValidHeapPointer Assertion failure. Microsoft has a solution( Initialization of native global objects requires CRT (C RunTime) startup routine).
This Solution requires
1. Set Linker\Advanced\Entry Point to "" (empty string)
2. Set Linker\System\Subsystem to Not Set
It allows the application and Form to run but an annoying console window appears.
I need help removing this console window or a better way than Microsoft's solution.
Please Help. Thanks.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
earlgraham wrote: 2. Set Linker\System\Subsystem to Not Set
It seems to me that should be set to /SUBSYTEM:WINDOWS. Don't know if that'll work though
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
If you set it to Windows the CRC is not loaded. I tryed.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Did setting it to WINDOWS automatically change the Linker\Advanced\Entry Point setting?
For a forms app, the Linker\Advanced\Entry Point setting is "main" and the Linker/System/Subsystem is WINDOWS.
For a Win32 app, Linker\Advanced\Entry Point is WinMainCRTStartup (or wWinMainCRTStartup for
unicode) and the Linker/System/Subsystem is WINDOWS.
So, it seems to me, you need Linker\Advanced\Entry Point set to WinMainCRTStartup (or
WinMainCRTStartup), the Linker/System/Subsystem set to WINDOWS, and change your "main" to
"_tWinMain" (or whatever the appropriate WinMain prototype is these days ) ...
WinMainCRTStartup will call a "WinMain", not "main".
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Changing the entry point to WinMain did not work but Changing it to the following removed the console window.
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
Thanks for the tips.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Cool!
earlgraham wrote: Changing the entry point to WinMain did not work
I said change to WinMainCRTStartup, not WinMain.
That's probably what entry point is being used if your _tWinMain() is getting called.
Cheers
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hai,
In my project there are 3 groups and each has 4 radio boxes.
if i check one radio box of a group than check in the other group is
remooved ? is there any problem in the property setting.
please guide me.
Help Ever Hurt Never
|
|
|
|
|
Are you still having trouble with this?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi all,
I have a component dll compiled as /clr (mixed), I cannot put a break point in any module,
could anyone suspect how to debug it?
Notice that:
The startup project is written in C# and it enables debugging for unmanaged code.
In the build configuration for the sicky dll:
Debugging/Attach property is set to true.
Linker/Debugging/Generate Debug Info property is set to true.
Linker/Debugging/Generate program databse file --> (the same name of the dll).pdb
The optimisation options are set to default.
Regards,
HZ
|
|
|
|
|
Hello,
Using this macro: _ASSERT_EXPR couses a compilation error at VS2005 compiler.
Do you know any other macro which can replace this one?
At crtdbg.h:
/* Asserts */
/* We use !! below to ensure that any overloaded operators used to evaluate expr do not end up at operator || */
#define _ASSERT_EXPR(expr, msg) \
(void) ((!!(expr)) || \
(1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, msg)) || \
(_CrtDbgBreak(), 0))
Thanks a lot!
|
|
|
|
|
Your _ASSERT_EXPR looks like _ASSERT_BASE in my version of crtdbg.h.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes. Is it compile at VS2005?
|
|
|
|
|
I looked in crtdbg.h from VS 2003.
I'm not sure why you are using something internal to the runtime library - these things can change
at any given version...
What are you trying to do?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
As I am dealing with the convertion of VS2003 to VS2005, I will use it at this stage until I will find better solution....
|
|
|
|
|
Cool whatever works
If it helps any, I believe it's used by the _ASSERT, _ASSERTE Macros[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi friends,
here is the problem I want to resolve:
- I have App 1: a C# application which I'm using now;
- I have App 2: a C++ application which exists and can provide me some useful informations I need in my c# application.
I want to know how I should do if I want to build a C++ application which will allow communication between application 1 and application 2. Let's call this bridge application, App 3.
I want to be able to do following things:
1- send data from App 1 (C#) to App 3 (C++);
2- parse data received from App 1 in App 3;
3- send data from App3 (C++) to App 2 (C++);
4- send back data from App2 (C++) to App 3 (C++);
5- send back data from App 3(C++) to App 1(C#);
6- Display my data in my C# application.
Has anyone of you already resolved this kind of "problem".
I would like App 3 (C++) to be Systray application which would use windows messages to make interprocess communications.
Can you please help me ?
I hope I've detailed enough the context.
Thanks !
Patrick.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
WM_COPYDATA is the easiest way to communicate between processes. There's no need for a bridging app, in fact, if there was one, then you'd need to handle messages between three apps, instead of two.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
thanks for your reply.
I'm going to use "WM_COPYDATA" since it seems to the best way to do that.
I can't really alter the existing C++ app, but I'll still have a communication by messages sending between two processes because I can create a new c++ app which can use the dependencies from the existing C++ one. I'll have to make communication between my C# application and the C++ one I'll have created.
I'm started looking at that.
Any idea in using the elements you guys think I'll need is welcome !
Thx !
Pat.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
Hello I have my interface and I want to introduce in the textBox "ContainerWidthtextBox" a value and if this value is lower then 0 to show me the messagebox to introduce a value grater than 0 but it give me an error like...Input string was not in a correct format.
private: System::Void ContainerWidthtextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
W = Convert::ToInt32(ContainerWidthtextBox->Text,CultureInfo::CurrentCulture);
try{
if(W <= 0)
{
MessageBox::Show("You must specify a Container Width greater than 0" , "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
return;
}
}
catch (System::FormatException())
{
}
|
|
|
|
|
Use int.TryParse instead of Convert::ToInt32. It's probably int::TryParse in C++/CLI
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
it's not working....
|
|
|
|
|
lavy2883 wrote: it's not working
What it? If you are getting exception it means that the string is not number
|
|
|
|
|
If I make the code like this
private: System::Void ContainerWidthtextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
W = Convert::ToInt32(ContainerWidthtextBox->Text);//, CultureInfo::CurrentCulture);
if(W <= 0)
{
MessageBox::Show("You must specify a Container Width greater than 0" , "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
return
}
}
it's not working either..it put me the same error...but if I have in may interface another textbox let's say ContainerHeighttextBox and if I put the code like this.....
private: System::Void ContainerWidthtextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
//the code was first here
}
}
private: System::Void ContainerHeighttextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
//now I put it here
W = Convert::ToInt32(ContainerWidthtextBox->Text);//, CultureInfo::CurrentCulture);
if(W <= 0)
{
MessageBox::Show("You must specify a Container Width greater than 0" , "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
return;
}
it's works but it's show me the messageBox after I introduce the value in the first textbox(it show me the messagebox at the seccond textbox not at the first where I need it )
lavi
|
|
|
|
|
You could also be having problems because you are using the TextChanged event. that means anytime you add/remove a character from the textbox it will fire this event which i don't think is what you want. I would rather use the Leave or Validating event. also i would do a bit more validating like checking for text length and use the Int32::TryParse like christian suggested.
if (ContainerWidthtextBox->TextLength > 0){
int w = 0;
if (Int32::TryParse(ContainerWidthtextBox->Text, w)){
if (w <= 0){
MessageBox::Show("You must specify a Container Width greater than 0" , "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
return;
}
}
else
MessageBox::Show("you did not enter a valid number.");
}
-- modified at 12:28 Monday 28th May, 2007
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
thanks..,that was not realy my problem ...for example if for the "ContainerWidthtextBox" I have the value 230 from the interface and I want to put a condition for the "ContainerHeighttextBox" to not be less than 2*ConatinerWidthtextBox.... I managed to do this(to put the condition)...but it not let me to introduce all the numbers for the ContainerHeighttextBox because it give me ..... after the first number... let's say "2" MessageBox that the number introduced is not....whatever...please help me.
Y can solve this problem only if I put the condition in the textBox that it's after the ContainerHeighttextBox..let's say...depttextBox
lavy
|
|
|
|