Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Translating VC++ to VB... 1

Status
Not open for further replies.

hererxnl

Technical User
Jul 8, 2003
239
US

Hopefully someone can point me in the right direction here. This question is half VC++, half VB so I hope it won't offend anyone.

I'm using a C++ SDK and trying to convert the header files to VB Bas. I've got some good reference for the translation but a few are proving to be elusive. Here are a couple that I just can't get, all help is greatly appreciated:

First is a Public Type Declaration:
Code:
typedef struct {
	DWORD		dwCurrentMilliSec ;
	DWORD		dwTotalMilliSec ;
	float		fRecMonitordB ;		// REC Monitor dB value
} WRITEINFO ;
Which I've translated to this:
Code:
Public Type WRITEINFO
    dwTotalMilliSec As Long
    dwCurrentMilliSec As Long
    float      fRecMonitordB ;     REC Monitor dB value
End Type
The problem is the translation of type "float". Can't find any info on this.

Next is this:
Code:
HANDLE DSSCreateFile( LPCTSTR lpDSSFileName, DWORD dwOpen, DWORD * lpError) ;
Can't find relevant info on HANDLE as it pertains to VB. Function/Sub/Something else???

Last one is this:
Code:
INT DSSSetWritePointer(HANDLE hDSSFile, DWORD dwStartMilliSec, BYTE *bRateMode, BYTE bInsert, BYTE bRecMonitor ) ;
I've translated UINT to VB Public Declare Functions and I suspect the INT to be similiar, but different, maybe?

I been everywhere looking for more info on this and hoped that the C++ board here would be as helpful as the VB board has been for me.

Thanks in advance.
 
Question 1
float in C = single in VB

Question 2
HANDLE in this instance is the same as the channel number in an open command.

Question 3
UINT/DWORD isn't the same as INT - the range is different. You can code UINT as long providing you take some precautions. Unless you are absolutely certain, do not compare using < and >. Be very careful if you are using all 32 bits.
 

xwb:

Thanks the help. Sorry it took so long to get back but we've got the flu going around and I was a lucky recipient.

I'm not sure I understand:
"HANDLE in this instance is the same as the channel number in an open command."

I'll research it. If you feel like expaining further that would be great but I fear we're crossing into VB territory here.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top