Click here to Skip to main content
15,888,733 members
Home / Discussions / C#
   

C#

 
GeneralRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Richard MacCutchan8-Oct-09 5:10
mveRichard MacCutchan8-Oct-09 5:10 
GeneralRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Henry Minute8-Oct-09 5:24
Henry Minute8-Oct-09 5:24 
GeneralRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Richard MacCutchan8-Oct-09 6:05
mveRichard MacCutchan8-Oct-09 6:05 
GeneralRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Dimitri Backaert8-Oct-09 11:19
Dimitri Backaert8-Oct-09 11:19 
AnswerRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
WBurgMo8-Oct-09 8:44
WBurgMo8-Oct-09 8:44 
GeneralRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Dimitri Backaert8-Oct-09 11:20
Dimitri Backaert8-Oct-09 11:20 
QuestionAdvanced combobox binding from code Pin
erfgerfgerger8-Oct-09 3:19
erfgerfgerger8-Oct-09 3:19 
QuestionTrouble calling cpp dll function whose input is char** [modified] Pin
platso_5888-Oct-09 2:22
platso_5888-Oct-09 2:22 
Hello,
I am Developing a C# WINDOWS application. In my Application i need to call a cpp dll which returns the list of Drives

connected to the PC.
The Function is "int GetDeviceDiskName(char**);". I can get all the drive names in my vc++ application after i call this

function.

char *device[10];

for(int i = 0; i < 10; i++)
{
device[i] = new char[10];
memset(device[i],0,10);
}
int nRes = GetDeviceDiskName(device);

device returns all the USB's attached to the PC.

But I have Trobule calling this function in C#.Net.

In my c# code i have declared the function in this manner,
[DllImport("../../Hanlin.dll", SetLastError = true, CharSet = CharSet.Ansi,CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 GetDeviceDiskName(String[] deviceName);


In c# i tried to call this function in this way,

char[] deviceName = new char[10];
int nStatus = GetHanlinDeviceDiskName(ref deviceName);

But I get Error as "Additional information: Attempted to read or write protected memory. This is often an indication that

other memory is corrupt."

Can some one help me how to call this function.

In the Dll file the "device" array will be updated in this way,
if(bDiskFound)
{
device[cnt][0]=cDiskID;
cnt++;
}

modified on Thursday, October 8, 2009 9:09 AM

AnswerRe: Trouble calling cpp dll function whose input is char** Pin
Luc Pattyn8-Oct-09 2:52
sitebuilderLuc Pattyn8-Oct-09 2:52 
Questionchange picture of image controll in gridvie in windows application???? [not solved yet...] Pin
mr.mohsen8-Oct-09 1:16
mr.mohsen8-Oct-09 1:16 
AnswerRe: change picture of image controll in gridvie???? Pin
Atif Ali Bhatti8-Oct-09 1:40
Atif Ali Bhatti8-Oct-09 1:40 
GeneralRe: change picture of image controll in gridvie???? Pin
mr.mohsen8-Oct-09 2:34
mr.mohsen8-Oct-09 2:34 
AnswerRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 4:18
Henry Minute8-Oct-09 4:18 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 7:30
mr.mohsen8-Oct-09 7:30 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 8:41
Henry Minute8-Oct-09 8:41 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 9:05
mr.mohsen8-Oct-09 9:05 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 9:44
Henry Minute8-Oct-09 9:44 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 12:24
mr.mohsen8-Oct-09 12:24 
QuestionCreating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 0:30
RobertFall8-Oct-09 0:30 
AnswerRe: Creating a Designer Add-In for Visual Studio Pin
Richard MacCutchan8-Oct-09 0:44
mveRichard MacCutchan8-Oct-09 0:44 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 0:48
RobertFall8-Oct-09 0:48 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
Richard MacCutchan8-Oct-09 1:08
mveRichard MacCutchan8-Oct-09 1:08 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 1:43
RobertFall8-Oct-09 1:43 
QuestionComparing for Columns Pin
Yonathan11117-Oct-09 23:25
professionalYonathan11117-Oct-09 23:25 
AnswerRe: Comparing for Columns Pin
Pete O'Hanlon8-Oct-09 0:02
mvePete O'Hanlon8-Oct-09 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.