Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a .DLL file from a .C file ?

Hi everybody

 

I'm looking for a method how to create a .DLL file from a .C file .That Dll file will be used to perform a board to measure voice quality accoding to the international standard named PESQ (perceptual evaluation of speech qualty) P.862.

Can anyone help to start dealing with Dlls and give some advices to avoid errors ?

 

thx

0 Kudos
Message 1 of 5
(47,335 Views)

Hi Sinaps,

 

The following document gives a walkthrough on creating a DLL in Visual Studio:

 

http://msdn.microsoft.com/en-us/library/ms235636(VS.80).aspx

 

Let me know if you have any questions regarding these steps!

 

 

Message Edited by Al B on 03-10-2009 12:54 PM
Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 5
(47,308 Views)

Hi sinaps,

 

You mention that you want to create a DLL from a .C file. Just to clarify, are you using C (.c file) or C++ (.cpp) to write your code?

Also, if you are using C++, are you using Visual Studio? (The reason I ask is because this forum is geared towards Measurement Studio, which is an add on to Microsoft Visual Studio).

 

That being said,

 

Thanks!

Message Edited by Jervin_J on 03-14-2009 02:02 PM
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 3 of 5
(47,276 Views)

 

Hi, I created DLL with C++ and it includes a function using NI::DataSocket.

I am trying to call that function from another C++ project and the function which is:

 

extern "C" __declspec(dllexport) double __cdecl Test()
{
   
   
   
       
    CNiDataSocket* socket = new CNiDataSocket; >>>>>Exception was thrown in this line
    socket->SetAccessMode(socket->ReadWriteAutoUpdate);
    socket->URL = "psp:\\localhost\Untitled Library 5\voltaj";
    socket->Connect();
    CNiDataSocketData data =  socket->GetData();
    double val = data.GetValue();
    delete socket;
    return val;

}

 

 

 

in dll returns exception : Microsoft C++ exception: NI::CNiOleException at memory location 0x0025f450.. 

 

Any idea?

 

Thanks a lot.

 

Ozan

0 Kudos
Message 4 of 5
(46,507 Views)

I see that you have posted on another More applicable forum (http://forums.ni.com/ni/board/message?board.id=231&requireLogin=False&thread.id=3761).  You shopuld be able to get a better answer from that forum as this post is a little unrelated. 

 

 

Charley Dahan

Global Account Manager
0 Kudos
Message 5 of 5
(46,475 Views)