|
Hi
I am creating a toolstrip,Menustrip.
can you tell me how to move a toolstrip from one place to another place.
|
|
|
|
|
|
Hi,
In Visual Studio, ProjectLocation dialog box is there know . How to create a dialogbox like that ? I want to create like this with the same operation. Can you tell me
Thank you,
|
|
|
|
|
What dialog are you talking about?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
1) When using null it show error: undeclared identifier. what can i do to declare a null? If no way to use null then what is the replacement for it?
2) How to declare array return type for a function?
In c# public byte[] type(); In c++/cli public array<byte> type(); not working. </byte>
modified on Monday, March 3, 2008 12:34 AM
|
|
|
|
|
|
1) nullptr
2) array<Byte> ^method();
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My GUI application called a function in a library (image processing library) but it takes 20 to 30 times more time to execute this function when comparing to the time required when calling standalone .exe file.
Both library and GUI compiled with managed c++ (pure:clr) and in the GUI there is a reference for the library as a additional dependencies in the linker input.
When I make .exe (using pure:MSIL) file instead of .lib and run from command line passing the required argument is just take one to one and half minute to execute it .
When I make the library file (bypassing the main function) from the same source code and calling the function from GUI takes arround 20 to 30 minutes. The source code for the library orginially written in C/C++ but I compiled it using manged c++ pure MSIL to match with the GUI.
Compilation and linking everything is fine and I can not find and explain the cause of 20 to 30 times slow running when library is used.
Is there anybody here in this forum help me or explain the possible cause of slow running.
Any idea, link, suggestion will be highly appreciated.
Thank you.
|
|
|
|
|
Hi,
are you sure you both the lib and exe are in /clr:pure? If the exe is /clr:pure and the lib is /clr, then it is possible that the whole program runs 20-30x slower. This is because of thunking between managed and native world, data type marshalling etc. It gets even worse when many functions are called in managed world (which is usual in image processing).
What you can do is compile your c++ functions in a DLL as native, and then just call 1 function from managed C++.
I'm also doing image processing, and am interested to know more.
|
|
|
|
|
thanks for your suggession.
I already created a DLL in naive code and importing a function to my GUI and used P/Invoke to call this function from GUI. It is much better but not yet perfect. It is 2 to 3 times slower now when comparing to the win32 console application.
Somebody suggested me to call the function in a seperate thread which I will try.
There might be some messsage pump working between GUI(Winform application) and native dll when I called the function.
If you have any other suggessions then let me know.
thank you again.
|
|
|
|
|
when i Serialize Object in My Application int the FileStream I can't
Deserialize FileStream in Other Application . so
how To Serialize Object in fileStream into My Application And Deserialize FileStream in other Application
|
|
|
|
|
What's not working? Code?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Snippet of the code not working could help us see where the problem may be...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
In other Application When Deserialize Object
errror : i can't find assembly Application name
|
|
|
|
|
in Serialize Application :Project Name = AppSerialize
//////////////////////////
Image ^image=Image::FromFile(file)
FileStream ^file=gcnew FileStream(...)
BinaryFormatter ^formatter=gcnew Binaryformatter;
formatter->Serialize(file,image);
////////////////////////////////////////////
In deserialize Application : Project Name =AppDeserialize
Image ^image....
FileStream ^file=gcnew FileStream(FileSerialize)
BinaryFormatter ^formatter=gcnew Binaryformatter;
image=(Image ^)formatter->Dererialize(file);
///////// Error In Deserialize
error : can not find assembly AppSerialize and .......
|
|
|
|
|
Did you ever get this working?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I can Serialize And Deserialize In One Application .
i workinn Server And client Application so i need Send Struct to Client
when i serialize Struct and Send , in client Application can't Deserialize Struct
|
|
|
|
|
The problem is, the same assembly needs to be used to deserialize as the one that serialized it.
There's ways around this though, if you don't want to keep a separate assembly to maintain
on both ends.
Please post the EXACT exception message (entirely) and I'll show you an example...If you'd like.
You can get the message from the exception by wrapping your deserialize code in a try block and
adding something like
...
catch ( SerializationException^ e )
{
Console::WriteLine( "Failed to deserialize. Reason: {0}", e->Message );
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
in SerializeApp :
[SerializableAttribute]
ref struct MyStruct
{
int n;
int j;
};
MyStruct ^my=gcnew MyStruct;
my->j=1;
my->n=1;
FileStream ^file=gcnew FileStream("c:\\Test.dat",FileMode::Create);
BinaryFormatter ^formatter=gcnew BinaryFormatter;
formatter->Serialize(file,my);
///////////////////////////////////////////
In DeserializeApp :
FileStream ^file=gcnew FileStream("c:\\Test.dat",FileMode::Open);
BinaryFormatter ^formatter=gcnew BinaryFormatter;
try
{
MyStruct ^my=(MyStruct ^)formatter->Deserialize(file);
}
catch (SerializationException^ e)
{
textBox1->Text=e->Message;
}
Error:
Unable to find assembly 'SerializeApp, Version=1.0.2987.23837, Culture=neutral, PublicKeyToken=null'.
|
|
|
|
|
|
Good article Giorgi!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark
|
|
|
|
|
|
You are welcome
|
|
|
|
|
When I Seriliaze Object In the File how To save Assembly Name And Typename with My self
|
|
|
|