473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Cstring problem VS.Net 2003

I am writing a MC++ wrapper for a native dll, that will be called by C#
applications.

One of the functions returns a CString parameter:

long GetProductStringDescriptor(int DevID, CString& sDescriptor)

My wrapper accepts a ref to a managed string (below) and needs to pass this
into to function so it is changed and returned.

GetProductStringDescriptor(int DevID, String __gc* __gc* StringDesc)

The problem I'm finding is that I get "Object not set to an insatance of an
object" errors when I call the unmanaged function. I have tried passing a
CString and String* into the function and converting it back to be returned.
Both of these options cause the error.

I have tried all the MSDN solutions on mixed dll's, and this has not helped.

Any help would be gratefully received.
Nov 17 '05 #1
0 1029

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bo bjerkeholt | last post by:
Just check that I got this right. I have an old DLL made in VC6 (no sources). Some of the methods have a CString as argument. No problem when using this from my VC6 application. I migrated my...
1
by: Sree | last post by:
When I compile existing MFC project in Visual Studio.NET 2003... I get class undefined error for CString... Does any one have experianced these problems? Thanks in advance Sree
0
by: Tony | last post by:
I have a managed C++ Console Application, and C++ Windows Forms application where I am trying to use an unmanaged header/lib file combo that exposes a class for functionality... The trouble I run...
5
by: Paul | last post by:
Hi, Any one knows how to convert CString to LPCWSTR? Please advice, thanks! -P
0
by: Senapathy | last post by:
Environment : WinXP SP2, .NET 2003 Std edition I posted a query to the group some days back asking about how to identify stack corruption / array bounds or buffer overruns using .NET compiler...
10
by: dotnetchic | last post by:
In VS 2003, I try creating a new VC7 MFC dll. Accepting all defaults, before adding ANY code, I get compiler errors out the wazoo having to do with this CString template. I ran across the same...
0
by: npotnis | last post by:
Hi All, I am trying to compile an existing C++ unamanaged application with the /clr switch in VS.Net 2003, as I need to use managed extensions in the code. In a cpp file I have the following...
4
by: huguogang | last post by:
Just curious, any one know what the 3 part parameter "class CString filename" would mean. The code: int TestFunc(class CString filename) { fopen(filename, "w"); } Compile using Visaul C++,...
4
by: sreenubkaimal | last post by:
Please help me with this.. I have a DLL created in Visual C++ 6.0 ( VS 6.0 ). I am trying to use this DLL in a new wrapper application written using Visual Studio .net 2003 (C++ - MFC). My...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.