473,796 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 GetProductStrin gDescriptor(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.

GetProductStrin gDescriptor(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 1056

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

Similar topics

1
2356
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 VC6 application --> VC7 (VS 2003) and then I get an error at link time saying something like error LNK2001: unresolved external symbol "public: int __thiscall CGMCAlarms::SetAlarm(class ATL::CStringT<char,class
1
1738
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
1665
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 into seems trivial enough, but a solution I've yet to find. I get the following errors when trying to compile may application... error LNK2001: unresolved external symbol "public: virtual class ATL::CStringT<char,class...
5
6611
by: Paul | last post by:
Hi, Any one knows how to convert CString to LPCWSTR? Please advice, thanks! -P
0
1090
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 switches. (E.g. /RTC1) The switches work fine for the sample programs that I wrote, but in my actual scenario it doesnt give any dumps or results in the output file. So I am unable to find if there is actually any stack / buffer overrun. The app...
10
1512
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 problem in porting some code over and compiling with the /clr switch and I resolved that issue by modifying a section of code that was typecasting a byte to a string (AFTER about a half-day of figuring out the right compiler options, and then...
0
2260
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 code : CString strRet; COleVariant var = m_pRSTFormList->GetFieldValue("FormName"); if(var.vt == VT_BSTR) strRet = var.pbVal;
4
4759
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++, there is no complain about the defintion. But
4
4921
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 DLL has many methods which uses CString as arguements and return values. At first, I got a Link error as
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.