|
Some suggestions:
* Try loading your DLL in Depends (from the Windows SDK) on XP. That will show you if there's a dependent DLL that's not preset on XP.
* Run fuslogvw.exe (part of the .NET SDK) and look for entries related to your Clarion app. It's possible that the .NET loader (fusion) is logging a more meaningful error when your assembly (DLL) is loaded.
* Check the OS event viewer logs. I've had stack traces show up in there sometimes when things aren't loading.
* Try writing a simple Win32 C++ app which loads your DLL and calls a dummy entry point to be sure that it's loadable *at all* on that OS. If not, it's probably a dependency issue like I mentioned above. If it's loadable then clearly it's an interaction with the Clarion app.
* Load your DLL project in dev studio and set the Clarion exe as the debug exe and check the boxes to break for All exceptions under Debug > Exceptions... when the load fails, is there any first-chance excetion triggered preceding the failure? (this one's a long-shot)
* Try using Procmon from sysinternals.com and monitor disk activity. Set the filter to include only you exe process name to remove lots of unrelated output. See if there are failures reported before the DLL load fails.
* Does your exported function happen to call code from another C# assembly you've created? If so, the related assembly may not be getting located properly as .NET searches in the .exe directory, not in the C++ DLL's directory. The first function using a type from the C# assembly can fail unless you've handled the AppDomain.AssemblyResolve event.
Good luck,
John
ps. I used Clarion back in 1990 or so...was DOS-based then. Wonder if its the same thing.
|
|
|
|
|
|
Hi all,
I'm building a "usercontrol" that has a contextmenustrip on it.
All is fine until I try to add an image to an item, it compliles ok but get a runtime error!
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "HexBox.HexEditBox.resources" was correctly embedded or linked into assembly "HexEditBox" at compile time, or that all the satellite assemblies required are loadable and fully signed.
I can only assume that it can not find the resource!
I checked the .resx file and the resource (image) is there.
Maybe it needs the be somewhere else, or a different process is require to use the contextmenustrip on a user control.
I tried the same process on a "form" and as expected all compiles and run as it should.
Using VS2008 Framework 3.5
Any help is appreciated.
Milton.
|
|
|
|
|
Hi!
Is there any function to create an XML file from Managed C++/CLI code(like System::IO::File::Create(L"Test.ini"); for plain files). I've to create an XML file from Managed C++/CLI code and write the following contents in it.
<?xml version='1.0'?>
<request>
<properties name="App_Path">E:\\Innosetup_files\\SG888\\</properties>
<properties name="langselected">en</properties>
</request>
How to create an XML file from Managed C++/CLI code and Write above contents? I've all the above contents in System::String^ variable.
modified on Thursday, March 10, 2011 8:08 AM
|
|
|
|
|
I think you are asking about System::XmlWriter[^].
I must get a clever new signature for 2011.
|
|
|
|
|
~Try something like this:
XmlTextWriter^ xmlTmp = gcnew XmlTextWriter(FileName, gcnew UTF8Encoding(false));
doc->Save(xmlTmp);
xmlTmp->Close();
The XML is stored in a DOM (Document Object Model). Note the Binary Order Mark supression - the UTF8 Encoding set to false. IF you leave this out then a couple of non printable characters appear in position 1:1. It upsets soapclient no end!
Ger
|
|
|
|
|
Hi!
Actually I've stored the XML contents(result of a HTTP Response) in a System::String^ variable. I've to write the contents of the String to an XML file. How to do this?
|
|
|
|
|
If the XML is properly formatted in the string, then just serialize the string to a text file and there you go.
Ger
|
|
|
|
|
The application has a screen size and resolution problem . What should be done since it looks very misery on desktops .
|
|
|
|
|
How can anyone guess? Please try and explain your problem in more detail.
I must get a clever new signature for 2011.
|
|
|
|
|
We need more details to even begin discussing this.
Are you asking how to determine the screen resolution? Can there be multiple monitors?
If so, I'd start with the Screens object in WinForms. Ex: System::Windows::Forms::Screen::AllScreens
Of course, you can also fall-back to Win32 calls to enumerate monitors and determine resolution and work area size from there too.
John
|
|
|
|
|
Here are the requested details :
I have the code and following error (C++ /CLI)
<br />
Rectangle ^ClientResolution = gcnew Rectangle();<br />
<br />
ClientResolution = Screen::GetBounds(); <br />
<br />
float CurrentWidth = 1366 ;<br />
float CurrentHeight = 768;<br />
<br />
float RatioWidth = ((float)ClientResolution->Width / (float)CurrentWidth );<br />
<br />
float RatioHeight =((float)ClientResolution->Height / (float)CurrentHeight);<br />
<br />
this->Scale(RatioWidth,RatioHeight); <br />
// error C2661: 'System::Windows::Forms:: Screen::GetBounds' : no overloaded function takes 0 arguments
|
|
|
|
|
There can be more than one monitor but if you only care about the primary monitor, try this:
Rectangle^ ClientResolution = Screen::PrimaryScreen->Bounds;
John
|
|
|
|
|
Thanks John also about the point which you indicated. Hovewer this time application's all windows are maximised which is actually not much preferable. I guess you already have a better idea to fix
the problem. Let me know please.
|
|
|
|
|
We still don't have enough info to guess the problem you're trying to solve.
Based on your code and follow-up here's what I think you are saying:
You have an application with maximized windows but they do not cover the entire desktop and you would like them to. What should you do to make them cover it? ie. you want a full-screen app.
OR possibly...
The application windows are maximized and hiding things and you want them scaled smaller?
OR
neither of these. Please add some more detail about what the current situation is and what the desired situation is.
John
|
|
|
|
|
fzerd wrote: System::Windows::Forms:: Screen::GetBounds' : no overloaded function takes 0 arguments
In which case why not check out the definition of the method you are calling here[^]?
I must get a clever new signature for 2011.
|
|
|
|
|
It's allright Screen::GetBounds(this->ClientRectangle)
Suprisingly it didn't work well. The width of the forms just became a little smaller.That's all.
The application still has a screen size or resolution problem. I am really confused.
|
|
|
|
|
fzerd wrote: The application still has a screen size or resolution problem. I am really confused.
Me too, as you have not made clear exactly what your problem is.
I must get a clever new signature for 2011.
|
|
|
|
|
Sorry i could't see the post. Of course , i am going to explain a simple version of my problem on an empty project. It is a C++ /cli desktop application.( .NET 3.5 )
On development machine (1280 by 720 pix) :
The application has two forms and a button.All form states are normal(default setting)I just customized to their sizes 100x150 and 150x100. That's all.
On client machine (1024 by 768 pix) :
A copy of the application's .exe was copied and clicked. It seems that initially all forms became maximized unexpectedly.
Any idea ?

|
|
|
|
|
fzerd wrote: Any idea ?
Not really, I have not seen this problem. I can only suggest you check all your settings in your forms and start up code to ensure nothing is maximising the windows.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi!
I've to get the string from the String Table. I used the following code:
wchar_t myDocs[1024];
::LoadString(NULL,IDS_USERNAME_CH,myDocs,1024);
It shows the following error:
error C2065: 'IDS_USERNAME_CH' : undeclared identifier
I've to read the string(with ID IDS_USERNAME_CH) from the string Table and set the Text to a label. How to do this in C++/CLI?
|
|
|
|
|
That message seems fairly clear, check where have you defined IDS_USERNAME_CH and make sure it is included in the module you are trying to compile.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi,
I have
System::String ^ St = gcnew System::String("Hey ho!");
std::string str("standard");
St = str;
The only way I can make it work is by doing gcnew again St = gcnew System::String(str.c_str()); but I'm guessing this is not the right way. All the examples I have found tell how to do this when creating a new instance of System::String but none how to do it with an existing one.
|
|
|
|
|
System::String() has no constructor that accepts a std::string Try this:
St = str->c_str();
I must get a clever new signature for 2011.
|
|
|
|
|
Tried it, no good.
error C2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'const char *' to 'System::String ^' <br />
|
|
|
|