473,320 Members | 1,695 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,320 software developers and data experts.

Dllimport, Help needed

Hi,
I try to use a c++ dll in a CS-project.
First i call a test method to receive the given parameter an compare
both:
extern DLLEXPORT char * DLL_Test(char *str){
return str;
}
This method is defined in a header file, in a seperate project of the
solution which provides the dll functions.
This works fine.
But when i try to start the application on another pc which doesnt have
an installed visual studio instance, but the same
installed .NET framework, the import of the dll failed.

Mar 20 '06 #1
2 1195

"alex" <ea***********@freenet.de> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi,
I try to use a c++ dll in a CS-project.
First i call a test method to receive the given parameter an compare
both:
extern DLLEXPORT char * DLL_Test(char *str){
return str;
}
This method is defined in a header file, in a seperate project of the
solution which provides the dll functions.
This works fine.
But when i try to start the application on another pc which doesnt have
an installed visual studio instance, but the same
installed .NET framework, the import of the dll failed.


You are probably missing MSVC runtime libraries and/or MFC (if your dll uses
it). You have to redistribute it or use static linking option in msvc. Check
with dependency walker utility (http://www.dependencywalker.com/) which dlls
your dll tries to load.

Regards,
Goran
Mar 20 '06 #2
Thanks,
the problem was the usage of mfc. I set to use mfc in a static library.
Now it works.

Greetings,
Alex

Mar 21 '06 #3

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

Similar topics

15
by: Jim | last post by:
I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the windows console the...
9
by: Ole Christensen | last post by:
I'm trying to make a sort of conditional compilation in my C# code because my app is intended to run on both a Pocket PC and on a normal desktop PC. My code uses a call to an API function that on...
3
by: Mark Jerde | last post by:
I'm sill learning VS .NET 2003, not an expert yet. I'm calling an unmanaged C++ DLL from C# using . When the whole project is done I will be calling a total of 5 C++ DLLs from C#. All the DLLs...
3
by: Gawel | last post by:
Hajo, I have two dlls, both of them are compiled with /clr switch. In first dll project I have managed and unmanaged classes. One of the unmanaged I would like to use outside therefore I marked...
2
by: Brian Anderson | last post by:
Hello, is it possible to use DllImport to call a DLL in ASP.NET ? Or is it necessarry that my DLL has to be copied into \System32 ? My DLL is a native C++ 7.1 DLL (not managed, no COM, no...
8
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2, C# for Windows application. I use DllImport so I can call up a function written in C++ as unmanaged code and compiled as a dll us vs2005. My application is able to...
3
by: Dan Holmes | last post by:
I have this DllImport attribute on an external C++ dll. What i am noticing that the dll isn't unloaded after the static method is complete. I was thinking that when the method (it is a static...
6
by: vivekanandaprasanth | last post by:
hi, I have exported a class which i have written in win32 static lib app. Now i have written a wrapper class for the same. But when i am trying to compile it is giving me some linker errors....
1
by: Larry | last post by:
I have an asp.net application (C#) that calls a web service that uses several c++ dlls which are loaded with DllImport. I put these dlls in a sub-directory off of the bin directory. For example,...
1
by: elke | last post by:
Hi, I want to use an unmanaged dll in C# .net and I'm having some troubles witch a function that should return an array. I'm new at this, so I don't know what I'm doing wrong. Here is some...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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.