Click here to Skip to main content
15,922,007 members
Home / Discussions / C#
   

C#

 
GeneralRe: disable all process Pin
Dave Kreskowiak2-Jan-09 3:30
mveDave Kreskowiak2-Jan-09 3:30 
AnswerRe: disable all process Pin
«_Superman_»1-Jan-09 14:35
professional«_Superman_»1-Jan-09 14:35 
QuestionHelp to access Digital Camera from C# Pin
AndersHolmström1-Jan-09 11:10
AndersHolmström1-Jan-09 11:10 
GeneralRe: Help to access Digital Camera from C# Pin
Luc Pattyn1-Jan-09 12:02
sitebuilderLuc Pattyn1-Jan-09 12:02 
GeneralRe: Help to access Digital Camera from C# Pin
Silvyster1-Jan-09 12:39
Silvyster1-Jan-09 12:39 
AnswerRe: Help to access Digital Camera from C# Pin
AndersHolmström1-Jan-09 13:04
AndersHolmström1-Jan-09 13:04 
GeneralRe: Help to access Digital Camera from C# Pin
Christian Graus1-Jan-09 17:54
protectorChristian Graus1-Jan-09 17:54 
QuestionVC++ DLL LIB and OCX in C# Win Form Application Pin
Karmendra Suthar1-Jan-09 7:37
Karmendra Suthar1-Jan-09 7:37 
Hi,
I purchased an USB based oscilloscope DSO-2150 from Hantek. Along with it came the VC++ DLLs (dll, lib and ocx).

I need to create a Winform application using C# Visual Studio Express Edition.

Please tell me is it possible to use VC++6 DLL in a C# appllication and if yes How?

Following is scrap from the manual provided with the DLL files.

DSO-XXXX USB SDK Manual

SDKXXXX.dll (VC++ 6.0)

Define struct
struct PictureRange{	// Be used for draw grid
    WORD width; 	// the width of display range
    WORD height; 	// the height of display range
    WORD left; 	//the left of display range
    WORD right;	 //the right of display range
    WORD top;	 //the top of display range
    WORD bottom; 	//the bottom of display range
};
struct ControlStruct{ 		//save the control data
WORD TriggerSource;	 //the trigger source
     WORD SelectedChannel; // the display channel
     WORD Timebase; 		// timebase 
     WORD TriggerPosition;	 // the trigger vertical position "0%,25%,50%,75%,100%"
     WORD DataLengh; 		// its value is 1 or 2, if BufferSize = 10, Datalengh = 1, else Datalengh =2
	WORD BufferSize ;		//Its value is 10,32 or 64
    	WORD isAlt;			//If ALT trigger, its value is 1, else 0.
};
struct LeversStruct{	//save position
        WORD Ch1Position;			// the ch1 waveform horizontal position
        WORD Ch2 Position;			// the ch2 waveform horizontal position
        WORD Ch1TriggerPosition;		// the ch1 trigger position
        WORD Ch2TriggerPosition;		// the ch2 trigger position
        WORD EXTTriggerPosition;	// the EXT trigger position
};
struct StateStruct{
	WORD Ch1Filt;			// ch1 filter
	WORD Ch2Filt;			//ch2 filter
	WORD TriggerFilt;		// trigger filter
	WORD TriggerMode;	//trigger mode (AUTO, NORMAL, SINGLE)
	WORD TriggerSlope;	//trigger slope (rising edge, failing edge)
};
struct LineColor{ 	// the waveform color
	WORD R;
	WORD G;
	WORD B;
};


struct AutosetStruct{		//save the autoset data
	WORD WhichChannel;	//which channel will autoset
	WORD Ch1Voltage;		//Ch1 autoset voltage
	WORD Ch2Voltage;		//Ch2 autoset voltage
	WORD Ch1Timebase;	//Ch1 autoset timebase
	WORD Ch2Timebase;	//Ch2 autoset timebase
	WORD Ch1InGND;		//Ch1 is in GND or not
	WORD Ch2InGND;		//Ch2 is in GND or not
	WORD Ch1Enabled;		//Ch1 enabled
	WORD Ch2Enabled;		//Ch2 enabled
};
struct TimeStruct{		//Save the time
	double Timer;		// the number of seconds elapsed since midnight
	double Time;		//the time of Timebase 
	double ScrollTime;	
	double ScrollStart;	
};
Functions:

1.	Functions for hardware:

WORD __stdcall sdSearchDevice (WORD DeviceIndex)
Variables introduction:
DeviceIndex:	 index of the device.
Note: This function is used for finding device.
If successful return 1, else return 0.

WORD __stdcall sdSetVoltageAndCoupling(WORD DeviceIndex,
									WORD Ch1Voltage
									WORD Ch2Voltage,
									WORD Ch1_ACDC,
									WORD Ch2_ACDC,
									WORD TriggerSource)
Variables introduction:
Ch1Voltage: index of the CH1 voltage
Ch2Voltage: Index of the CH2 voltage
Ch1_ACDC: index of the CH1 Coupling ( AC is 1, DC is 0, GND is 0 )
Ch2_ACDC: index of the CH2 Coupling
TriggerSource: index of the trigger source (CH1 trigger is 0, CH2 trigger is 1, ALT trigger is 2, EXT trigger is 3)
Note: This function is used for setting voltage and Coupling. If successful return 1, else return 0.

WORD __stdcall sdSetTriggerAndSampleRate(WORD DeviceIndex,
										WORD TriggerSlope,
									Struct ControlData *Controlstate)
Variables introduction:
TriggerSlope: the trigger type (Rising edge is 0, Failing edge is 1)
Note: This function is used for setting trigger and timebase.
If successful return 1, else return 0.

bool __stdcall sdSetOffset(WORD DeviceIndex,
						struct LeversData * Levers,
						WORD Ch1_Att,
						WORD Ch2_Att,
						WORD TriggerSource,
						WORD * level)
Variables introduction:
level: array of the channel position adjust data, read from hardware.
Note: This if used for adjusting the position of the channel. If successful return true, else return false.

WORD __stdcall sdSetFilt (WORD DeviceIndex,
						struct StateStruct *FiltAndTrigger)
Note: This function is used for setting channel and trigger filter. If successful return 1, else return 0.

WORD __stdcall sdCaptureStart(WORD DeviceIndex)
Note: This function is starting to capture data. If successful return 1, else return 0.

long __stdcall sdTriggerEnabled(WORD DeviceIndex)
Note: This function is used for setting the trigger. If successful return 1, else return 0.

WORD __stdcall sdGetLevel(WORD DeviceIndex,WORD * level)
Note: This function is used for reading the waveform position adjust data from hardware. If successful return 1, else return 0.

WORD __stdcall sdGetData(WORD DeviceIndex,
						WORD Ch1_Att,
						WORD Ch2_Att,
						WORD * Ch1HardwareData, 
						WORD * Ch2HardwareData,
						struct ControlData *Controlstate,
						struct StateStruct *FiltAndTrigger,
						struct LeversData *levers,
						WORD *level,
						int StartCapture
								 )
Variables introduction:
Ch1HardwareData: save ch1 data from hardware
Ch2HardwareData: save ch2 data form hardware
StartCapture: capture data flag. If start to capture is 1, else is 0.
Note: This function is used for reading data from the hardware. If successful return 1, else return 0.

2.	Functions for software:
WORD __stdcall sdMainPanelDrawGrid (HDC hdc,
struct PictureRange * view_data)
Variables introduction:
Hdc: //  handle to the display picture
Note: This function is used for drawing grid on panel. If successful return 1, else return 0.

WORD __stdcall sdDisplayDataXYMode(HDC hdc,
									 struct PictureRange * view_data, 
									 WORD isLine, 
									 WORD * ch1_data, 
									 WORD * ch2_data)
Variables introduction:
isLine:	//point or line display. 
Note: This function is used for displaying data with X-Y Mode. If successful return 1, else return 0.

WORD __stdcall sdGetDisplayData(struct ControlData *Controlstate,	  
								WORD * ChDispalyData, 
								WORD * ChBufferData
								)
Variables introduction:
ChDisplayData:		//save Channel display data 
ChBufferData:		//save Channel data
Note: This function is used for getting display data. If successful return 1, else return 0.

WORD __stdcall sdDisplayData (HDC hdc,
							struct PictureRange * DisPicture, 
							WORD PointOrLine, 
							WORD * ChDisplayData,
							struct LineColor * ch_color)
Note: This function is used for displaying data on screen.

WORD __stdcall sdChannelDataBuffer (struct ControlData *Controlstate, 
WORD InterpolationLineMode,  
WORD * chx_data,
WORD * ch_data)
Variables introduction:
InterpolationLineMode:	//its value is 1, 0, or 2
Note: This function is used for processing data and copying data to "chx_data" from "ch_data". If successful return 1, else return 0.

WORD __stdcall sdChannelInGND (WORD Ch1Position, 
WORD *chdata)
Note: This function is used for processing data when channel is in GND. If successful return 1, else return 0.

WORD __stdcall sdAutoset (WORD DeviceIndex,
						struct ControlData *Controlstate,
						struct AutosetStruct *AutosetData,
						struct StateStruct *FiltAndTrigger,
						struct LeversData * levers,
						WORD *level
								 )
Note: This function is used for automatically setting. If successful return 1, else return 0.

WORD __stdcall sdGetScrollData(WORD DeviceIndex,
							struct ControlData *Control_Data1,
							struct LeversData *levers,
							struct TimeStruct *TimeState,
							WORD Ch1Voltage,
							WORD Ch2Voltage,
							WORD *Ch1ScrollData,
							WORD *Ch2ScrollData,
							WORD *Ch1DisplayData,
							WORD *Ch2DisplayData,
							WORD TriggerPosition,
							bool Ch1InGND,
							bool Ch2InGND
									   )
Note: This function is used for getting and processing data when channel is in scroll mode. If successful return 1, else return 0.


double __stdcall sdDisplaySampling (bool Ch1Enabled,
								bool Ch2Enabled,
								WORD TriggerSource,
								WORD Timebase,
								WORD BufferSize)

Note: This function is use for Display Sampling on main panel status bar. 


Wish a very Happy New Year,
Thanks and Warm Regards,
KarmendraRose | [Rose]
AnswerRe: VC++ DLL LIB and OCX in C# Win Form Application Pin
Luc Pattyn1-Jan-09 7:58
sitebuilderLuc Pattyn1-Jan-09 7:58 
GeneralRe: VC++ DLL LIB and OCX in C# Win Form Application Pin
Karmendra Suthar1-Jan-09 19:20
Karmendra Suthar1-Jan-09 19:20 
GeneralRe: VC++ DLL LIB and OCX in C# Win Form Application Pin
Luc Pattyn1-Jan-09 20:38
sitebuilderLuc Pattyn1-Jan-09 20:38 
GeneralRe: VC++ DLL LIB and OCX in C# Win Form Application Pin
Karmendra Suthar2-Jan-09 21:17
Karmendra Suthar2-Jan-09 21:17 
GeneralRe: VC++ DLL LIB and OCX in C# Win Form Application Pin
Luc Pattyn3-Jan-09 1:33
sitebuilderLuc Pattyn3-Jan-09 1:33 
QuestionTo enter values in GridView dynamically after clicking edit link in GridView Pin
suni_dotnet1-Jan-09 6:40
suni_dotnet1-Jan-09 6:40 
QuestionReadString, ReadChar(s), ReadByte(s)... Pin
Jumpin' Jeff1-Jan-09 6:15
Jumpin' Jeff1-Jan-09 6:15 
AnswerRe: ReadString, ReadChar(s), ReadByte(s)... Pin
PIEBALDconsult1-Jan-09 6:19
mvePIEBALDconsult1-Jan-09 6:19 
GeneralRe: ReadString, ReadChar(s), ReadByte(s)... Pin
Luc Pattyn1-Jan-09 6:45
sitebuilderLuc Pattyn1-Jan-09 6:45 
GeneralRe: ReadString, ReadChar(s), ReadByte(s)... Pin
Jumpin' Jeff1-Jan-09 9:33
Jumpin' Jeff1-Jan-09 9:33 
Questionbutton click through another program Pin
Deresen1-Jan-09 2:38
Deresen1-Jan-09 2:38 
AnswerRe: button click through another program Pin
Christian Graus1-Jan-09 2:59
protectorChristian Graus1-Jan-09 2:59 
AnswerRe: button click through another program Pin
Silvyster1-Jan-09 12:43
Silvyster1-Jan-09 12:43 
GeneralRe: button click through another program Pin
Deresen1-Jan-09 21:14
Deresen1-Jan-09 21:14 
AnswerRe: button click through another program Pin
Eddy Vluggen2-Jan-09 2:03
professionalEddy Vluggen2-Jan-09 2:03 
GeneralRe: button click through another program Pin
Deresen2-Jan-09 2:14
Deresen2-Jan-09 2:14 
GeneralRe: button click through another program Pin
Eddy Vluggen2-Jan-09 2:26
professionalEddy Vluggen2-Jan-09 2:26 

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.