Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: ColorDialog Location Pin
Rocky Moore9-Jun-03 17:13
Rocky Moore9-Jun-03 17:13 
GeneralRe: ColorDialog Location Pin
patnsnaudy10-Jun-03 2:41
patnsnaudy10-Jun-03 2:41 
GeneralDeriving from System.Drawing.Image troubles... Pin
Mike Zinni9-Jun-03 7:22
Mike Zinni9-Jun-03 7:22 
GeneralRe: Deriving from System.Drawing.Image troubles... Pin
krisp9-Jun-03 12:22
krisp9-Jun-03 12:22 
Generalusing unmanaged c in c# Pin
Courtney Layne9-Jun-03 6:22
sussCourtney Layne9-Jun-03 6:22 
GeneralRe: using unmanaged c in c# Pin
Ranjan Banerji9-Jun-03 6:32
Ranjan Banerji9-Jun-03 6:32 
GeneralRe: using unmanaged c in c# Pin
Nathan Blomquist9-Jun-03 7:25
Nathan Blomquist9-Jun-03 7:25 
GeneralRe: using unmanaged c in c# Pin
clayne10-Jun-03 6:23
clayne10-Jun-03 6:23 
Option 3 sounds the simplest, I was unsure if that was possible.

My c api is not very complicated, just not very portable. The api relies on a properly setup application environment to function correctly. Mostly environment variables and an oracle client.

Here is a dll I created to perform a simple query. I can easily call this from another c/cpp console app and everything works fine. Jut not sure how to get it into a c#.net app.

Code Example:
#include <prointlnk.h>
#include <string.h>
#include <stdlib.h>

__declspec(dllexport) char* query(char*);

char* query(char* instring)
{
static char outstring[256];
char buff[20];

HPDMPDM pdm;
PTCERROR err = PDM_SUCCESS;
HPDMPI pi_handle = NULL_HPDMPI;
HPDMBRANCH branch_handle = NULL_HPDMBRANCH;
HPDMPIV piv_handle = NULL_HPDMPIV;
PTCSTRING piv_rev = NULL, part_name = NULL;
PTCINTEGER piv_ver = 0;

err = PDMConnectToPDM("username", "password", &pdm);

err = PDMPIGetByName( instring, &pi_handle );

if ( PDM_HANDLE_IS_NULL( pi_handle ))
{
strcpy( outstring, "Object Not Found" );
return outstring;
}

// Get the main branch handle.
err = PDMPIGetMainBranch( pi_handle, &branch_handle );

// Get the latest PIV handle.
err = PDMBranchGetLatestPIV( branch_handle, &piv_handle );

// Get the revision and version.
err = PDMPIVGetRevision( piv_handle, &piv_rev );
err = PDMPIVGetVersion( piv_handle, &piv_ver );

// Construct the output string. Longterm goal is XML string
strcpy( outstring, "name = '" );
strcat( outstring, instring );
strcat( outstring, "';" );

strcat( outstring, "rev = '" );
strcat( outstring, piv_rev );
strcat( outstring, "';" );

_itoa (piv_ver,buff,20);
strcat( outstring, "ver = '" );
strcat( outstring, buff );
strcat( outstring, "'" );

return outstring;
}
GeneralRe: using unmanaged c in c# Pin
Nathan Blomquist10-Jun-03 11:27
Nathan Blomquist10-Jun-03 11:27 
GeneralExtending C# XML comment feature. Pin
Donald_a9-Jun-03 2:12
Donald_a9-Jun-03 2:12 
GeneralOwner draw panel Pin
aeros9-Jun-03 1:41
aeros9-Jun-03 1:41 
GeneralDrives available on PC Pin
Andy H9-Jun-03 1:20
Andy H9-Jun-03 1:20 
GeneralRe: Drives available on PC Pin
Rocky Moore9-Jun-03 6:19
Rocky Moore9-Jun-03 6:19 
QuestionCrystal reports?? Pin
Marix8-Jun-03 21:42
Marix8-Jun-03 21:42 
Generalcopying from File to File Pin
Irisshnirer8-Jun-03 20:05
sussIrisshnirer8-Jun-03 20:05 
GeneralRe: copying from File to File Pin
Kannan Kalyanaraman8-Jun-03 22:14
Kannan Kalyanaraman8-Jun-03 22:14 
GeneralRe: copying from File to File Pin
Anonymous8-Jun-03 22:27
Anonymous8-Jun-03 22:27 
GeneralRe: copying from File to File Pin
Irisshnirer8-Jun-03 22:32
sussIrisshnirer8-Jun-03 22:32 
GeneralRe: copying from File to File Pin
Kannan Kalyanaraman8-Jun-03 22:50
Kannan Kalyanaraman8-Jun-03 22:50 
Generalrename filename Pin
benzite8-Jun-03 17:27
benzite8-Jun-03 17:27 
GeneralRe: rename filename Pin
Rocky Moore8-Jun-03 18:12
Rocky Moore8-Jun-03 18:12 
GeneralRe: rename filename Pin
benzite9-Jun-03 14:39
benzite9-Jun-03 14:39 
Questionhow can I know the pixel is black or white? Pin
JeffSayHi8-Jun-03 17:21
JeffSayHi8-Jun-03 17:21 
AnswerRe: how can I know the pixel is black or white? Pin
Philip Fitzsimons9-Jun-03 3:35
Philip Fitzsimons9-Jun-03 3:35 
GeneralS.Rod and anyone who can help me ! Pin
tuan_tomy8-Jun-03 16:45
tuan_tomy8-Jun-03 16:45 

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.