Ok Christian, thanks for all the help but I managed to track down the error. Must of had some other bug I fixed before when I tried to compile everything under the same project because otherwise it should have worked.
The thing is that in the FMatrix.h header file included in the Test project I wasn't including the private definitions. I thought that the header acted more like an interface than anything else and thus private members were not needed.
Once I included the private definitios in the FMatrix.h header file inside the Test app the problem disappeared.
(An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).
The C++/CLI wrapper method will be accessed from C# as follows:
string x="some value", y="another value", z="a third value";
managed.ManagedMethod( x, y, z );
The problem I am having is converting the managed string handle (String^ y) to an unmanaged VARIANT parameter. I would like to be able to solve this problem without having to modify the unmanaged C++ code. Does anyone have any suggestions or ideas on how to do this?
Sure but my level of apathy for people writing production code that can't blow their own nose is fairly high today.
I feel like starting a new CodeProject account with the user name "HellNo" for replying to all the "can you provide the code" lovelies. Or maybe I shoudl write a programming book titled "Copy Paste for Idiots"... wait...
Copy the following code and paste it into your code file at the appropriate location:
<code>int n = 11;</code>
Now modify the code until it produces the desired results.
There finished... now all I need is to send it off to a publisher.
could you provide some sample code of how to do this? I thought of doing that, but I couldn't get it to work.
Since you've already written code to convert String^ to BSTR, I presume your problem is with converting that to a VARIANT. To do that, you can use _variant_t which has a constructor that takes a BSTR, and use that. You can pass _variant_t anywhere a VARIANT is expected.
I have a simple DLL file that performs an smtp email function for one of my applications. The problem with the DLL is - it sends an OK dialog box to the user once the email has successfully been sent. I was wondering if it were simple enough for you to remove the OK dialog box from the DLL.
If successful the OK dialog box should not appear after the email has been sent.
Can a DLL be changed like this, or do I have to create a new one altogether?
Independant programmer for small business. Client management solutions
I have posted this under Visual Studio too as i was unsure of the correct fourm.
I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am able to print the report. I tried all member methods - Visible, Show, BringToFront, set_Size etc. Am i missing something.?
Here is the code snippet for your ref:
crReportDocument = new ReportDocument();
// MessageBox("Report Document Instance Created", "New Reports");
// MessageBox("File Loaded to Report Document Instance ", "New Reports");
//Setup the connection information structure to be used
//to log onto the datasource for the report.
crConnectionInfo = new ConnectionInfo();
// MessageBox("Connection Info set", "New Reports");
//Get the table information from the report