Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Working with a picture box Pin
MALDATA27-Jun-05 10:58
MALDATA27-Jun-05 10:58 
GeneralRe: Working with a picture box Pin
Ravi Bhavnani27-Jun-05 11:21
professionalRavi Bhavnani27-Jun-05 11:21 
GeneralRe: Working with a picture box Pin
MALDATA27-Jun-05 13:54
MALDATA27-Jun-05 13:54 
GeneralRe: Working with a picture box Pin
David Crow27-Jun-05 14:46
David Crow27-Jun-05 14:46 
GeneralRe: Working with a picture box Pin
MALDATA27-Jun-05 15:09
MALDATA27-Jun-05 15:09 
GeneralRe: Working with a picture box Pin
MALDATA28-Jun-05 6:17
MALDATA28-Jun-05 6:17 
Generaldisconnecting a tcp connection Pin
godofinferno27-Jun-05 7:52
godofinferno27-Jun-05 7:52 
GeneralCalling a function in a DLL question. ( corrupted data ) Pin
Maximilien27-Jun-05 7:24
Maximilien27-Jun-05 7:24 
Good afternoon.

I have a DLL with a simple function that receives an array of double, the array is used as input/output, part of it I must fill, the rest ( the result ) is filled by the DLL.

the function looks like :

typedef int (__stdcall * CommandProc)( 
  long,    /// ID
  double*, /// array ( size is rows x columns )
  long,	   /// Number of rows
  long	   /// Number of columns
  );



I do the following.
m_Data = (double*) calloc( m_Rows * m_Columns, sizeof( double );

/// fill m_Data with Values.
int iRes = ProcAdd( 1, m_Data, m_Rows, m_Columns );

/// returned m_Data is corrupted, values that should not be overwritten are modified..


The DLL is loaded properly, and the function is called without crashing.

I'm not sure if I'm calling the function with the "right kind" of values ( mostly the double*; the simplistic documentation that I have tells me its a double*; so that's what I pass.

I tried doing a simple DLL function with similar parameters to see if I screwed my call :

extern "C" _declspec(dllexport) int toto(	
  long ID,
  double* data,
  long rows, 
  long columns )
{
 for ( int i = 0 ; i < rows*colums; i++ )
 {
  data[i] = 2;
 }
 return 1;
}


but that seems to work.

any ideas ?

I'm about to contact the DLL vendor to ask them for a working C example of their DLL.

Thanks.

Max.



Maximilien Lincourt
Your Head A Splode - Strong Bad
GeneralRe: Calling a function in a DLL question. ( corrupted data ) Pin
David Crow27-Jun-05 9:32
David Crow27-Jun-05 9:32 
QuestionWhy doesn't it do what it's suppose to do? Pin
tomek1827-Jun-05 6:35
tomek1827-Jun-05 6:35 
AnswerRe: Why doesn't it do what it's suppose to do? Pin
David Crow27-Jun-05 7:32
David Crow27-Jun-05 7:32 
GeneralRe: Why doesn't it do what it's suppose to do? Pin
tomek1827-Jun-05 21:07
tomek1827-Jun-05 21:07 
GeneralRe: Why doesn't it do what it's suppose to do? Pin
David Crow28-Jun-05 2:16
David Crow28-Jun-05 2:16 
AnswerRe: Why doesn't it do what it's suppose to do? Pin
FlyingTinman27-Jun-05 13:30
FlyingTinman27-Jun-05 13:30 
GeneralMersenne Twister Pin
jdrobinson8127-Jun-05 5:59
jdrobinson8127-Jun-05 5:59 
GeneralRe: Mersenne Twister Pin
toxcct27-Jun-05 6:21
toxcct27-Jun-05 6:21 
GeneralRe: Mersenne Twister Pin
jdrobinson8127-Jun-05 6:42
jdrobinson8127-Jun-05 6:42 
GeneralRe: Mersenne Twister Pin
jdrobinson8127-Jun-05 6:42
jdrobinson8127-Jun-05 6:42 
GeneralRe: Mersenne Twister Pin
FlyingTinman27-Jun-05 11:48
FlyingTinman27-Jun-05 11:48 
GeneralRe: Mersenne Twister Pin
jdrobinson8127-Jun-05 12:39
jdrobinson8127-Jun-05 12:39 
GeneralRe: Mersenne Twister Pin
FlyingTinman27-Jun-05 13:18
FlyingTinman27-Jun-05 13:18 
Questionis there anyway to move mouse to any point? Pin
ugur_basak27-Jun-05 5:55
ugur_basak27-Jun-05 5:55 
AnswerRe: is there anyway to move mouse to any point? Pin
Ravi Bhavnani27-Jun-05 5:56
professionalRavi Bhavnani27-Jun-05 5:56 
GeneralRe: is there anyway to move mouse to any point? Pin
ugur_basak27-Jun-05 6:12
ugur_basak27-Jun-05 6:12 
GeneralRe: is there anyway to move mouse to any point? Pin
Ravi Bhavnani27-Jun-05 6:28
professionalRavi Bhavnani27-Jun-05 6:28 

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.