Convert Foxpro Code To VB Code - Help
Dear members,
I have a code in Visual Foxpro as follows;
PUBLIC FLAGPATROL FLAGPATROL = 0 PUBLIC COUNTER COUNTER = 0 PUBLIC NPORTNO NPORTNO = THISFORM.COMBO1.VALUE PUBLIC DWMAXCOUNT DWMAXCOUNT = 5000 PUBLIC READVIDEXDATA READVIDEXDATA = .F. PUBLIC WNUM WNUM = 0 PUBLIC BEGINNUM SELECT MAIN BEGINNUM = RECCOUNT() DIMENSION PDWIBUTTONNUMBER(DWMAXCOUNT) PDWIBUTTONNUMBER = SPACE(4*DWMAXCOUNT) DIMENSION PDWTIME(DWMAXCOUNT) PDWTIME = SPACE(4*DWMAXCOUNT) DECLARE INTEGER GetAllInfo IN SomeDll.dll INTEGER @, STRING @, STRING @, INTEGER, INTEGER FLAGPORT = GETALLINFO(@WNUM, @PDWIBUTTONNUMBER, @PDWTIME, DWMAXCOUNT, NPORTNO) ----------
How to convert it in Visual Basic? I tried to create a function in a module like this:
Declare function GetAllInfo Lib "SomeDll.dll" (ByVal Wnum as Integer,ByVal PdwIButtonNumber as String,ByVal PdwTime as String,ByVal MaxData As Integer, nPort as Integer) as Integer
When I call that function from the program :
data = GetAllInfo( num,button,time,200,1)
The VB alert An Illegal Operation, and then closed.
Note: I used that function to retrieve data from device via RS-232, original software used Visual Foxpro and SomeDll.dll
Thanks for help...
Nal
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Convert Html Source Code To Vb Code
I would like to be able to enter html source code into a text box and then when I push a button I want that code to be modified to vb code.
An example would be:
HTML code:
<html>
<body>
Hello World<br>
<a href="http://www.nba.com">NBA</a><br>
</body>
</html>
VB code:
strHTML = "<html>" _
& vbCrLf & "<body>" _
& vbCrLf & "Hello World<br>" _
& vbCrLf & "<a href="& Chr(34) & "http://www.nba.com" & Chr(34) & ">NBA</a><br>" _
& vbCrLf & "</body>" _
& vbCrLf & "</html>"
I think I can use the replace function to replace all " with Chr(34) but my main issue is getting & vbCrLf & " at the beginning of each line. Does anyone know a way to cycle through each line of a text file and append data at the front of the line? How about append to the rear (end of line)?
Thanks for any advice/help in advance.
Convert This Vbscript Code To Vb 2005 Code
Is it possible to convert this code to visual basic 2005 code?
'Script to enable the Manual Proxy Server Configuration in Internet Explorer Options.
'Possible requirement of admin privileges when running this script
'The entry adds the value only to the current user - HKEY_CURRENT_USER.
'In order to add all the users, we have to enumerate throuh all the SIDS.
Dim WSHShell,RegLocation ,RegValue, NewValue
Set WSHShell = WScript.CreateObject("WScript.Shell")
' to modify the below registry location you must either use regedit or some other programmatic
' method to insert a binary array
RegLocation = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsConnectionsDefaultConnectionSettings"
binRegValue = WSHShell.RegRead(RegLocation)
'To uncheck "Automatically detect settings" and to check "Use a proxy server..." you need
' this first section of the binary array: 3c,00,00,00,fe,00,00,00,03
binString="hex:3c,00,00,00,fe,00,00,00,03"
For i=9 to ubound(binRegValue)
binString=binString & "," & hex(binRegValue(i))
Next
'WScript.Echo binString
RegBinWrite RegLocation, binstring
WScript.Quit
' Write REG_BINARY array
sub RegBinWrite(keyName,value)
ptr=instrRev(keyName,"")
key="[" & left(keyName,ptr) & "]"
val=chr(34) & right(keyName,len(keyName)-ptr) & chr(34)
valString=val & "=" & value
Set fso=CreateObject("Scripting.FileSystemObject")
Set file=fso.CreateTextFile("temp.reg",true)
file.WriteLine("REGEDIT4")
file.WriteLine(key)
file.WriteLine(valString)
file.close
Set Shell=CreateObject("Wscript.Shell")
Shell.Run "regedit /s temp.reg",1,true
Set Shell=nothing
fso.DeleteFile "temp.reg"
Set fso=nothing
end sub
Thanks,
Mike
Connecting To Foxpro Database Help (Code Snippet Included)
Hi gurujis,
Can someone pls help me as to how can i connect to a foxpro database using vb6???
I have currently tried it using the following code but doesnt help.
Can you pls tell me wht should be changed in the following snippet pls
VB Code:
Private Sub Form_Load() Dim objCon As ADODB.ConnectionDim objCom As ADODB.CommandDim objRS As ADODB.Recordset Set objCon = New ADODB.ConnectionSet objCom = New ADODB.Command objCon.ConnectionString = "provider=vfpoledb.1;sourcetype=dbc;data source=c:chiragdatasahil.dbc" objCon.Open objCon.ConnectionString MsgBox "Connection opened" With objCom.ActiveConnection = objCon.CommandText = "SELECT * FROM stock".CommandType = adCmdTextEnd With With objRS.Open , objCon, adOpenDynamic, adLockBatchOptimisticEnd With MsgBox "Recordset Open" End Sub
How To Convert C Code To Vb Code
Hi,
May i know how to convert C code below to VB code:
byte addr, int npoints, long *path, int freq
Actually what is the meaning of *path in c code?
Can Anyone Convert This C Code To Vb6 Code
void decryptPassword(const char *encrypt_pass, char *s)
{
char str[128], ch;
char hs[] = { 0, 0, 0 };
int v1, v2, i, l;
int begin_found = 0;
*s = 0;
for(i = 0; encrypt_pass[i*2]; i++)
{
hs[0] = encrypt_pass[i*2]; hs[1] = encrypt_pass[i*2+1];
v1 = strtol(hs, 0, 16);
hs[0] = encrypt_pass[i*2+4]; hs[1] = encrypt_pass[i*2+5];
v2 = strtol(hs, 0, 16);
if(!begin_found)
{
if(v1 == v2) begin_found = 1;
}
else
{
if(v1 != v2)
begin_found = 0;
else
{
i += 3;
break;
}
}
}
if(!begin_found) return;
for(ch = 0, l = 0; encrypt_pass[i*2+2]; i++, l++)
{
hs[0] = encrypt_pass[(i-2)*2]; hs[1] = encrypt_pass[(i-2)*2+1];
v1 = strtol(hs, 0, 16);
hs[0] = encrypt_pass[i*2]; hs[1] = encrypt_pass[i*2+1];
v2 = strtol(hs, 0, 16);
ch = (ch + (char)v1) ^ (char)v2;
str[l] = ch;
}
str[l] = 0;
CharToOem(str, s);
}
Convert Vbs Code To Vb Code
the following is a vbs code and want to convert it into a vb code so that i can create or made an .exe file. thanks in advance
Set ows = CreateObject("WScript.Shell")
Set oWmi = GetObject("winmgmts:")
sWmiq = "select * from Win32_Process where name='EXCEL.EXE'"
Set oQResult = oWmi.Execquery(sWmiq)
For Each oProcess In oQResult
iRet = oProcess.Terminate(1)
Next
set ows = nothing
set owmi = nothing
Convert .xls To .mdb Thru Code
Hi,
I am just wondering if it's possible to convert an excel file. [.xls] to Access Database file [.mdb] using visual basic code.
thanks,
jenios.
Convert Code
Could anyone please help me in converting the coding found on point 7 of this support.microsoft.com webpage:
to work using Visual Basic (legacy) linked to an access database.
I have my database all prepared and linked through Visual Basic. I just need the code in section 7 to function.
At the moment, the code found on the above website is tailored to run through modules using just Microsoft Access.
Thank you
Convert Vbs To Vb Code
I've been trying to change my vbs to a vb so that I can make a little utility kit. I have the following vbs code that runs flawlessly and I'm trying to make a vb from it. I've got the inputbox and message box working, its the remainder that Ic annot figure out. I have no experience in programming so I'm a work in progress...
vbs:
Code:
'Set the server name
strComputer = InputBox("Enter Computer Name Here", "Server UpTime Query")
Set objShell = CreateObject("WScript.Shell")
'Run uptime to generate the data
Set objWshScriptExec = objShell.Exec("cmd /c uptime.exe " & " \" & strComputer)
Set objStdOut = objWshScriptExec.StdOut
'Get the details
strLine = objStdOut.ReadLine
'Display the result
msgbox strLine, vbokonly, "Server UpTime Results"
So far in VB:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myServer As Object
Dim response As MsgBoxResult
Dim line As String
Dim ID As String
myServer = InputBox("Enter Computer Name Here", "Server UpTime Query")
ID = Shell("cmd /c C: empatchuptimeuptime.exe", , True, 100000)
line = Console.ReadLine()
response = MsgBox(line)
End
End Sub
Edit by moderator: You can use the [vb] tags to format your code, to make it easier to read. Click 'Edit' or 'Reply' on this post to see how they work, or read all about tags here.
It also helps if you post VB.NET questions in the right forum (= not in the VB6 section). Thanks.
Convert C++ Code
i have got some source code written in c++ that i want to convert into vb code - because i can't understand anything about c++ code. is there a way to convert this. b2c.exe converts vb into c++, is there a tool that works the other way?
thanks
adam
How To Convert This C Code To Vb
KPocket PCs come with a build in KernelIoControl() to return serial number of the handheld.
Code:
#include <WINIOCTL.H>
extern "C" __declspec(dllimport)
BOOL KernelIoControl(
DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize,
LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned
);
#define IOCTL_HAL_GET_DEVICEID CTL_CODE(FILE_DEVICE_HAL, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
CString GetSerialNumberFromKernelIoControl()
{
DWORD dwOutBytes;
const int nBuffSize = 4096;
byte arrOutBuff[nBuffSize];
BOOL bRes = ::KernelIoControl(IOCTL_HAL_GET_DEVICEID,
0, 0, arrOutBuff, nBuffSize, &dwOutBytes);
if (bRes) {
CString strDeviceInfo;
for (unsigned int i = 0; i<dwOutBytes; i++) {
CString strNextChar;
strNextChar.Format(TEXT("%02X"), arrOutBuff[i]);
strDeviceInfo += strNextChar;
}
CString strDeviceId =
strDeviceInfo.Mid(40,2) +
strDeviceInfo.Mid(45,9) +
strDeviceInfo.Mid(70,6);
return strDeviceId;
} else {
return _T("");
}
}
Guys, is it possible to convert this code into visual basic? Using what? Windows API calls or something?
How to convert this line to VB?
BOOL bRes = ::KernelIoControl(IOCTL_HAL_GET_DEVICEID,
0, 0, arrOutBuff, nBuffSize, &dwOutBytes);
Convert Code From Vb.net To Vb6
can somebody help me to convert code below to become code used in vb6.
Code:
Public Function distance(ByVal lat1 As Double, ByVal lon1 As Double, ByVal lat2 As Double, ByVal lon2 As Double, ByVal unit As Char) As Double
Dim theta As Double = lon1 - lon2
Dim dist As Double = Math.Sin(deg2rad(lat1)) * Math.Sin(deg2rad(lat2)) + Math.Cos(deg2rad(lat1)) * Math.Cos(deg2rad(lat2)) * Math.Cos(deg2rad(theta))
dist = Math.Acos(dist)
dist = rad2deg(dist)
dist = dist * 60 * 1.1515
If unit = "K" Then
dist = dist * 1.609344
ElseIf unit = "N" Then
dist = dist * 0.8684
End If
Return dist
End Function
Private Function deg2rad(ByVal deg As Double) As Double
Return (deg * Math.PI / 180.0)
End Function
Private Function rad2deg(ByVal rad As Double) As Double
Return rad / Math.PI * 180.0
End Function
Convert C Code To VB
Hi,
I'm having trouble converting the following code to VB. Is there anyone who can convert it to VB 6 for me?
Thanks in advance!
void Histogram8bpp( BYTE *pFrame, int FrameSize, DWORD *Mh ) {
int i;
memset( Mh, 0, 256 * sizeof( DWORD ) );
for ( i = 0; i < FrameSize; i++, pFrame++ ) {
Mh[ *pFrame ]++;
}
}
void Histogram24bpp( RGB24 *pFrame, int FrameSize, DWORD* Rh, DWORD *Gh, DWORD *Bh ) {
int i;
memset( Rh, 0, 256 * sizeof( DWORD ) );
memset( Gh, 0, 256 * sizeof( DWORD ) );
memset( Bh, 0, 256 * sizeof( DWORD ) );
for ( i = 0; i < FrameSize; i++, pFrame++ ) {
Rh[ pFrame->r ]++;
Gh[ pFrame->g ]++;
Bh[ pFrame->b ]++;
}
}
WhiteBalance( BYTE *pRawFrame, int W, int H, BOOL FlipH, BOOL FlipV, double *mR, double *mB ) {
int x, y;
DWORD R = 0, G = 0, B = 0;
if ( !FlipH && !FlipV ) {
// G R
// B G
for ( y = 0; y < H/2; y++ ) {
for ( x = 0; x < W/2; x++ ) {
G += *pRawFrame++;
R += *pRawFrame++;
}
for ( x = 0; x < W/2; x++ ) {
B += *pRawFrame++;
G += *pRawFrame++;
}
}
} else if ( !FlipH && FlipV ) {
// B G
// G R
for ( y = 0; y < H/2; y++ ) {
for ( x = 0; x < W/2; x++ ) {
B += *pRawFrame++;
G += *pRawFrame++;
}
for ( x = 0; x < W/2; x++ ) {
G += *pRawFrame++;
R += *pRawFrame++;
}
}
} else if ( FlipH && !FlipV ) {
// R G
// G B
for ( y = 0; y < H/2; y++ ) {
for ( x = 0; x < W/2; x++ ) {
R += *pRawFrame++;
G += *pRawFrame++;
}
for ( x = 0; x < W/2; x++ ) {
G += *pRawFrame++;
B += *pRawFrame++;
}
}
} else { // if ( FlipH && FlipV ) {
// G B
// R G
for ( y = 0; y < H/2; y++ ) {
for ( x = 0; x < W/2; x++ ) {
G += *pRawFrame++;
B += *pRawFrame++;
}
for ( x = 0; x < W/2; x++ ) {
R += *pRawFrame++;
G += *pRawFrame++;
}
}
}
G = G / 2;
*mR = -1.0;
*mB = -1.0;
if ( R > 0 ) *mR = (double)G / (double)R;
if ( B > 0 ) *mB = (double)G / (double)B;
}
Need To Convert This C Code Into Vb...
hi, anyone can help i need this code into vb for my project
this code is under c
VB Code:
//// Algoritmo códigos de liberación DCT3// Algorithm unlock codes DCT3//// indear// #include <stdio.h>#include <string.h> void ASCII2HEX (unsigned char *origen, unsigned char *destino, int caracteres);unsigned char convertir_byte_a_hex (unsigned char byte);unsigned char calculo4_a (char caracter);void calculo4 (unsigned char *cadena);void calculo3 (unsigned char *cadena);void calculo2_a (unsigned char *cadena, unsigned char byte, unsigned char byte2);void calculo2 (unsigned char *cadena, unsigned char byte, unsigned char byte2);void calculo1 (unsigned char byte, unsigned char *network_code_h, unsigned char *imei_h);void calculo1_a (unsigned char *cadena);void calcular_dct3 (unsigned char *imei, unsigned char *network_code, unsigned char *destino); void ASCII2HEX (unsigned char *origen, unsigned char *destino, int caracteres){ int i, j; unsigned char aux1, aux2; j=0; for(i=0; i<caracteres; i+=2) { aux1 = convertir_byte_a_hex(origen[i])<<4; if (i+1 < caracteres) aux2 = convertir_byte_a_hex(origen[i+1]); else aux2 = 0; destino[j] = aux1 | aux2; j++; }} unsigned char convertir_byte_a_hex (unsigned char byte){ if ((byte > 57) || (byte < 48)) // '0' a '9' return (byte-55); else return (byte-48); // 'A' a 'F' o otro caracter} unsigned char calculo4_a (char caracter){ unsigned char aux1, aux2, aux3, temp; int i; aux1=0; aux2=7; temp=0; for (i=0; i<8; i++) { aux3=caracter; aux3=aux3>>aux2; aux3&=1; aux3=aux3<<aux1; temp|=aux3; aux1++; aux2--; } return temp;} void calculo4 (unsigned char *cadena){ char temp[12]; int i; memcpy(temp, cadena, 12); for (i=0; i<12; i++) { cadena[11-i]=calculo4_a(temp[i]); } }void permu1(unsigned char *network_code_hex, unsigned char *tabla, unsigned char *imei_hex){ unsigned char *puntero; int i; puntero=tabla; for (i=0; i<11; i++) { calculo1(*puntero, network_code_hex, imei_hex); calculo2(network_code_hex, 0, 8); calculo3(network_code_hex); calculo2(network_code_hex, 8, 0); puntero++; } calculo1(tabla[11], network_code_hex, imei_hex); calculo4(network_code_hex);}void calculo3 (unsigned char *cadena){ unsigned char aux1, aux2, aux3, temp1, temp2; char temp[12]; int i; memcpy(temp, cadena, 12); temp2=12; temp1=7; aux1=3; for(i=0; i<12; i++) { aux2=temp1; aux3=aux1; aux2=temp[aux2]; aux2^=0xFF; aux2|=temp[aux3]; temp2--; if (temp1==0) temp1=12; temp1--; if (aux1==0) aux1+=12; aux3=temp2; cadena[aux3]^=aux2; aux1--; }} void calculo2_a (unsigned char *cadena, unsigned char byte, unsigned char byte2){ unsigned char aux1, aux2, aux3; unsigned char *puntero; int i,j; if (byte==0) return; for (i=0; i<byte; i++) { aux1=cadena[byte2+3]; aux1&=1; puntero=cadena+byte2; for (j=0; j<4; j++) { aux2=*puntero; aux3=aux2; aux2=aux2>>1; aux1=aux1<<7; aux2|=aux1; aux3&=1; *puntero=aux2; aux1=aux3; puntero++; } }} void calculo2 (unsigned char *cadena, unsigned char byte, unsigned char byte2){ calculo2_a(cadena, 10, byte); calculo2_a(cadena, 31, byte2);} void calculo1 (unsigned char byte, unsigned char *network_code_h, unsigned char *imei_h){ unsigned char aux1, aux2; int contador; unsigned char *puntero, *puntero2; puntero=network_code_h; puntero2=imei_h; contador=0; aux1=0; while (contador < 12) { aux2=aux1; aux2=(aux2>>1) % 3; aux2&=1; aux2*=byte; aux2^=(*puntero2); (*puntero)^=aux2; aux1++; puntero++; puntero2++; contador++; } calculo1_a(network_code_h);} void calculo1_a (unsigned char *cadena){ // 60 bytes char tabla1[] = {0x01,0x09,0x04,0x08,0x0B,0x05,0x09,0x08,0x06,0x0A, 0x01,0x03,0x0B,0x06,0x0A,0x00,0x08,0x07,0x0B,0x0A, 0x01,0x05,0x00,0x08,0x03,0x01,0x09,0x00,0x02,0x0A, 0x05,0x03,0x07,0x02,0x0A,0x00,0x04,0x03,0x0B,0x02, 0x05,0x09,0x00,0x04,0x07,0x01,0x05,0x04,0x02,0x06, 0x09,0x07,0x0B,0x02,0x06,0x04,0x08,0x03,0x07,0x06}; // 60 bytes char tabla2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, 0x01,0x00,0x01,0x01,0x01,0x00,0x01,0x00,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}; unsigned char *puntero=cadena; unsigned char aux1, aux2; int contador1, contador2, contador3; char variable_8c[12]; contador1=0; aux1=0; aux2=0; while (contador1<12) { contador2=5; aux2^=*puntero; while (contador2>0) { if ((tabla2[aux1] == 0) && (contador1 <6)) { variable_8c[tabla1[aux1]]=*puntero; } else { variable_8c[tabla1[aux1]]^=*puntero; } aux1++; contador2--; } contador1++; puntero++; } for (contador3=0; contador3<12; contador3++) variable_8c[contador3]^=aux2; memcpy(cadena, variable_8c, 12); } void calcular_dct3 (unsigned char *imei, unsigned char *network_code, unsigned char *destino){ char tabla[] = {0xb1,0x73,0xe6,0x5a,0xab,0x47,0x8e,0x0d,0x1a,0x34,0x68,0x0b}; //12 bytes char network_code_h[12], imei_h[12]; int i, j; unsigned char aux1; memset(network_code_h, 0, sizeof(network_code_h)); memset(imei_h, 0, sizeof(imei_h)); ASCII2HEX(network_code, network_code_h, (int)strlen(network_code)); ASCII2HEX(imei, imei_h+2, 14); for (i=2; i<12; i++) imei_h[i]^=0xa5; permu1(network_code_h, tabla, imei_h); j=0; for (i=0; i<5; i++) { aux1=network_code_h[i]; if ((aux1&0x80) == 0x80) aux1+=0xa0; if ((aux1&0x08) == 0x08) aux1+=0xfa; destino[j]=(aux1 >> 4) + 0x30; j++; destino[j]=(aux1 & 0x0F) + 0x30; j++; } destino[j]=0;}void main() { // examples - ejemplos char destino[11]; calcular_dct3 ( "111111111111119", "22222", destino); // Code1 use network code printf("#pw+%s+1#
", destino); // Codigo1 usar el codigo de operador calcular_dct3 ( "111111111111119", "FFFF", destino); // Code2 use GID1 printf("#pw+%s+2#
", destino); // Codigo2 usar el GID1}
How To Convert This C++ Code To VB
What will be the equivalent of this enumeration in VB
Code:
typedef enum BrowserNavConstants {
navOpenInNewWindow = 0x1,
navNoHistory = 0x2,
navNoReadFromCache = 0x4,
navNoWriteToCache = 0x8,
navAllowAutosearch = 0x10,
navBrowserBar = 0x20,
navHyperlink = 0x40
} BrowserNavConstants;
Thanks in advance
Convert This C Code To VB
Hi,
I need to do something very similar to the code below, that is, declare an array of move counts (the # of possible moves for any piece at a given position), and fill it with data right away. Unfortunately, I don't know if VB allows for this, or what syntax to use if it does. Please help!
VB Code:
unsigned char num_moves[4][32] = { // Number of moves for a piece at a position {2,2,2,1, 1,2,2,2, 2,2,2,1, 1,2,2,2, 2,2,2,1, 1,2,2,2, 2,2,2,1, 0,0,0,0}, {2,2,2,1, 2,4,4,4, 4,4,4,2, 2,4,4,4, 4,4,4,2, 2,4,4,4, 4,4,4,2, 1,2,2,2}, {0,0,0,0, 1,2,2,2, 2,2,2,1, 1,2,2,2, 2,2,2,1, 1,2,2,2, 2,2,2,1, 1,2,2,2}, {2,2,2,1, 2,4,4,4, 4,4,4,2, 2,4,4,4, 4,4,4,2, 2,4,4,4, 4,4,4,2, 1,2,2,2}};
Convert Code
is there an easy way to convert existing code in qbasic into visual basic. im using visual basic 6
thanks in advance
Help Me Convert Code
http://www.pscode.com/vb/scripts/Sho...25753&lngWId=1
I want my program to register every 3 letter name on aol by editing the source of the program to register them but it need to also have random emails please help.
Thanx.
-Dan
Ps. I have a wordlist of every 3 letter combo thx to joacim
Ps.The author said i could do this.
Convert This C Code To VB?
Can anyone help to convert this C code to VB?
Code:
#include
#include
#include "guilib.h"
int putt (char *strControlName);
int LogOff (HANDLE hHandle);
void main()
{
char Hostname[50];
char SystemID[5];
char Client[5];
char User[20];
char Passwd[20];
char Language[5];
HANDLE hHandle;
PIT_EVENT pEvt = 0;
strcpy (Hostname,"hostname");
strcpy (SystemID,"00");
strcpy (Client,"100");
strcpy (User,"UNAME");
strcpy (Passwd,"PASSWD");
strcpy (Language,"E");
hHandle = It_NewConnection(Hostname, SystemID, SAPGUI_FRONT);
It_Login (hHandle, Client, User, Passwd, Language );
while ( It_GetEvent(hHandle, &pEvt) )
{}
}
Help! Convert This Code From C++ To VB Anyone?
Hey can anyone help with this, i'm trying to convert this small bit of C++ code into Visual Basic.
All this code does is print out a string of characters like this
-S65RY- 7HU86- W2YTR- 2T4EE
it is totally random with numbers and characters appearing anywhere. I would be so grateful,
Charlie
void main( void )
{
int i,j;
char *s=NULL;
int c;
/* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );
for (j=0; j<4; j++)
{
printf("-");
for (i=0; i<5; i++)
{
c = (rand()%43)+48;
while ((c > 57 && c < 65))
c = (rand()%43)+48;
printf( "%c",c);
}
}
while (1);
}
Please Anyone Convert This Code To Vb
function decodePart(str) {
var m = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-";
var result = "";
var packer = 0;
var count = 0;
var i = 0;
for (i=0; i < str.length; i++) {
// Get the offset to the current character in our map
var x = m.indexOf(str.charAt(i));
// For invalid characters, point them out really well!
if(x<0) {
result += " > " + str.charAt(i) + " < ";
continue;
}
// only count valid characters...why not?
count++;
// Pack them bits.
packer = packer << 6 | x
// every four bytes, we have three valid characters.
if (count == 4) {
result += String.fromCharCode((packer >> 16) ^ 67);
result += String.fromCharCode((packer >> 8 & 255) ^ 67);
result += String.fromCharCode((packer & 255) ^ 67);
count=0; packer=0;
}
}
// Now, deal with the remainders
if(count==2) {
result += String.fromCharCode((( (packer << 12) >> 16) ^ 67));
} else if(count == 3) {
result += String.fromCharCode(( (packer << 6) >> 16) ^ 67);
result += String.fromCharCode(( (packer << 6) >> 8 & 255) ^ 67);
}
return result;
}
function decodeCC(str) {
var m = "0123456789ABCDEF";
var result = "";
var i = 0;
for (i=0; i < str.length; i++) {
//
var x = str.charCodeAt(i)-32;
if (x<10) x = "0"+x;
result += x+" "; // convert x to string
}
return result;
}
How Do You Convert This VBA Code To VB.NET?
I'm in the process of converting a VBA program to VB.NET (2005) and let me tell you... it's been an adventure. One brick wall after another. It's really annoying how so many things work in one environment but not in the other.
The problem I've come across now is some code that trims a string. I can't seem to figure out the VB.NET equivalent of the following VBA code:
strReturn = Trim$(Left$(strBuffer, intSpaces))
Can someone help me out?
Convert Code To Vb.net
Hi ,
I have been Code by visual basic 6 .I tried several times to convert vb.net or C#.net but occurred promblem for checkbox and option ( checkbox , radiobutton --in .net) ----- in the following code :
VB6
====
Dim ctrl as Control
Dim ffrm as Form
For each ctrl in ffrm.Controls
If typeof ctrl is checkbox then
if ctrl.value = 1 then
msgbox ("OK")
End if
End if
Next
-------------
VB.Net
=====
Dim ctrl as Control
Dim ffrm as Form
For each ctrl in ffrm.Controls
If typeof ctrl is checkbox then
if ctrl.checked(checkeState) then ' Here not Accepet (I ask what the parametar equal "value" !!
=====PROBLEM=========
End if
End if
Next
-----------------
C#.net
=======
using System.Windows.Forms;
class Ctrll
{
public void CtrlOk
{
Form ffrm;
foreach (control ctrl in ffrm.controls)
{
if (ctrl.Gettype().name= = ("CheckBox")
{
if ctrl.checked(checkeState) then ' Here not Accepet (I ask what the parametar equal "value" !!
}
{
==========BROBLEM==================
}
}
}
}
}
========
Pls I'm waiting repley.
Thnks
Ashraf.
Please Help Me On How To Convert VB 6 Code In ASP
Hi friends,
I m new bee in ASP,Can any one guide me on how to convert existing VB 6.0 code to ASP.
My application is done on Vb which reads excel files and inserts data in Ms access Please help me on how to convert this in ASP.
(for code plz see attchment)
Thanks
Ritik
Convert VB Code To VC++
I don't know VB, but I have to convert VB to VC++, some one help me please.
VB codes are as following:
option Explicit
' Note: This program includes a references to:
'
' Microsoft ActiveX Data Objects 2.6 Library (ADO)
' Microsoft ADO Ext. 2.6 for DDL and Security (ADOX)
'
private Sub cmdExecute_Click()
Dim app_path as string
Dim db_file as string
Dim conn as ADODB.Connection
Dim adox_catalog as ADOX.Catalog
Dim adox_table as ADOX.Table
Dim rs as ADODB.Recordset
Dim i as Integer
Dim txt as string
' Find the application path.
app_path = App.Path
If Right$(app_path, 1) <> "" then app_path = app_path & ""
' Open the Depts database.
db_file = app_path & "Depts.mdb"
set conn = new ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & db_file & ";" & _
"Persist Security Info=false"
conn.Open
' Create a link to the Employees table
' in the Emp database.
set adox_catalog = new ADOX.Catalog
' This statement ties the linked
' table to the open connection.
set adox_catalog.ActiveConnection = conn
set adox_table = new ADOX.Table
With adox_table
set .ParentCatalog = adox_catalog
.Name = "LinkedTable"
.Properties("Jet OLEDB:Link Datasource") = app_path & "Emps.mdb"
.Properties("Jet OLEDB:Link Provider string") = "MS Access"
.Properties("Jet OLEDB:Remote Table Name") = "Employees"
.Properties("Jet OLEDB:Create Link") = true
End With
' Add the table to the Tables collection.
adox_catalog.Tables.Append adox_table
' Perform the query.
set rs = conn.Execute( _
"SELECT * " & _
"FROM Departments, LinkedTable " & _
"WHERE Departments.DepartmentId = LinkedTable.DepartmentId", , _
adCmdText)
' Display the results.
Do While Not rs.EOF
txt = txt & rs.Fields(0).Value
for i = 1 to rs.Fields.Count - 1
txt = txt & ", " & rs.Fields(i).Value
next i
txt = txt & vbCrLf
rs.MoveNext
Loop
rs.Close
txtResults.Text = txt
' Delete the link from the Depts database.
adox_catalog.Tables.Delete "LinkedTable"
' Close the database.
conn.Close
End Sub
private Sub Form_Resize()
Dim hgt as Single
hgt = ScaleHeight - txtResults.Left - txtResults.Top
If hgt < 120 then hgt = 120
txtResults.Move txtResults.Left, txtResults.Top, ScaleWidth, hgt
End Sub
Jennifer
Convert To VB Code
Can anyone convert the following C code to VB? Thanks in advance!!!
Code:
#ifndef __RA_EXTROUTINE_H__
#define __RA_EXTROUTINE_H__
#define MAX_PARAMS10
/*MSC assumes LSB first, 32 bit integers */
#pragma pack(push,1)
struct RoutineControlWord// 4 bytes (32 bit word) total
{
unsigned ErrorCode : 8;// Error code if ER bit is set.
// -- end byte 0 --
unsigned NumParams : 8;// From 0 to MAX_PARAMS,
// -- end byte 1 --excludes control structure
unsigned ScanType : 2;// 16-17 Normal, Pre, Post (0, 1, 2)
unsigned ReservedA : 2;// 18-19 Reserved Set A: DO NOT USE
unsigned User : 2;// 20-21 Defined by Ext Rtn developer
unsigned ReservedC : 2;// 22-23 Reserved Set C: DO NOT USE
// -- end byte2 --
unsigned EnableIn : 1;// 24 Incoming rung status
unsigned EnableOut : 1;// 25 Returning rung status
unsigned FirstScan : 1;// 26 First Normal Scan occurring
unsigned ER : 1;// 27 Control ERROR
unsigned ReservedB : 1;// 28 Reserved Set B: DO NOT USE
unsigned DN : 1;// 29 Control DONE
unsigned ReturnsValue : 1;// 30 Indicates if routine returns anything
unsigned EN : 1;// 31 Control ENABLE
// -- end byte 3 --
};
#pragma pack(pop)
enum EXT_ROUTINE_PARAM_TYPE_E // 4 bytes long
{
FloatingPointValue = 0,// e.g., float p
FloatingPointAddress,// e.g., float* p
IntegerValue,// e.g., short p
IntegerAddress,// e.g., long* p
ArrayAddress,// e.g., int p[]
StructureAddress,// e.g., MyStructT* p
VoidAddress,// e.g., void* p
Void,// e.g., "No return value"
LastEntryInEnum
};
// Structure representing the type of the parameter defined
// for the External Routine.
struct EXT_ROUTINE_PARAMETERS// 12 bytes long
{
// Size of parameter/array element in bits
unsigned long bitsPerElement;
// If array, number of elements else 1.
unsigned long numberOfElements;
// Numeric representation and reference type.
EXT_ROUTINE_PARAM_TYPE_E paramType;
};
// Fixed size structure defining JXR's signature and control.
struct EXT_ROUTINE_CONTROL// 4 + 120 + 12 = 136 bytes long
{
RoutineControlWordctrlWord;
EXT_ROUTINE_PARAMETERSparamDefs[MAX_PARAMS];
EXT_ROUTINE_PARAMETERSreturnDef;
}
Convert VBA Excel Code From DAO To ADO
Hi Everybody
Can someone help me with this. I am trying to convert a Excel VBA code to create a MS Access database from DAO technology to ADO technology. A snippet of the code is shown below. It comes up with an error at the last line shown in my attempts to append the table to the database.
Code:
Dim adoxCat As New ADOX.Catalog
Dim tbl As New ADOX.Table
adoxCat.Create "Provider='Microsoft.Jet.OLEDB.4.0';Data Source='" & Application.Path & "" & "TempDb.mdb';"
thispath = "'" & Application.Path & "" & "TempDb.mdb'"
tbl.Name = "ArrayData"
colCount = UBound(startArray, 2)
With tbl
start = 0: wrkg = start
Do While wrkg <= colCount
thisFieldName = "Field" & wrkg
.Columns.Append thisFieldName, adDouble
wrkg = wrkg + 1
Loop
End With
'Comes up with error - Type is invalid! What is wrong here!
adoxCat.Tables.Append tbl
Best regards
Deepak Agarwal
Convert Line Of Code
Last question for a while. I have this code:
Code:
Hyperlinks.Add Anchor:=Cells(i, 28), Address:="", SubAddress:=R.Address
Instead of being a hyperlink it brings over, I would like it to bring over its value copied. Also, its two neighboring cells. It's pretty obvious, I'm pretty new to vba.
Thanks for the help!
Kindly Convert This Code...
we are not allowed to use variables in this program so i want to omit the intCntr but still getting the same result. what code to be used instead of this?
For intCntr = 0 To UBound(Split(txtInput.Text, " "))
list1.AddItem Split(txtInput.Text, " ")(intCntr)
Next intCntr
sample input: visual basic program
output: visual
basic
program
other looping control can be used or maybe a control if that's possible.
Convert C Code To VB For Access2000
I hope this is the right way to post this question. I searched the forums for converting code, but didn't find what I wanted. If there is another forum or thread that I should have used, I appologize; maybe some moderator can move this post to the correct place.
I wrote in a program in C to schedule snack duty for preschool mothers. The program inputs school calendar and student info and then schedules snack duty for the school year, taking into account birthdays, holidays, days in school, siblings, etc. so that the snack duty is evenly spread across all the students.
I have started to create a pleasing UI to input all the data and display the results. I am totally new to Access2000 and VBA, but have created several Tables and Forms to support the schedule program. I have some form/subform/continuous display problems I am working through, but I need to start thinking about putting the smarts of the schedule program into the Access2000 UI (I have a button which would start this process and wind up populating a calendar form with the output data).
I guess I am looking for tips on how to convert the C code into VBA. Any help would be greatly appreciated.
THANX in advance
HexReader
How Do I Convert The Below For Next Code To A Do LOOP?
First thanks in advance to the creators of this forum and any who provide assistance. I'm a newbie learning VBScript and trying to grasp the fundamentals. How would I use a DO LOOP to perform the code that is performed by the FOR NEXT statement below. The script allows me to list all the files in the starting point and any subfolders it also echos the path on the screen.
Set FS0=CreateObject("Scripting.FileSystemObject")
ShowSubFolders FSO.GetFolder("C:")
Sub ShowSubFolders(Folder)
For Each SubFolder in Folder.SubFolders
Wscript.Echo SubFolder.Path
ShowSubFolders SubFolder
Next
End Sub
Once again Thanks a lot
Convert A Bit Of Code From Excel To Vb6
have this code which fills a blank text box with a date
Code:
Private Sub Command3_Click()
Text5.Text = DateAdd("d", Text2.Text / Text4.Text, Text3.Text)
If vbYes = MsgBox("Add the new values to the database?", vbYesNo + vbQuestion, "Approval to Add") Then
Adodc1.Recordset.AddNew
End If
End Sub
what i am trying to do is convert this code from spread sheet
=TEXT(C2-(TODAY()-B2)*D2,"00")
to fill another blank text box at the same time
this is what i have but dosnt work any help please
text6.text = (text2.text-(today()-text3.text)*text4.text,"00"
Code:
Private Sub Command3_Click()
Text5.Text = DateAdd("d", Text2.Text / Text4.Text, Text3.Text)
text6.text = (text2.text-(today()-text3.text)*text4.text,"00"
If vbYes = MsgBox("Add the new values to the database?", vbYesNo + vbQuestion, "Approval to Add") Then
Adodc1.Recordset.AddNew
End If
End Sub
Convert VB Code To HTML
I've been writing more tutorials, and would like to be able to just copy some VB code snippets into a TextBox, and generate W3 valid HTML that can be easily pasted into an HTML file.
I've seen pretty much all of the VB2HTML codes out there on www.pscode.com and other sites, but mine is a little different.
I want to use pure CSS for the styling. I will enter the CSS code myself, but the output of the generator needs to be like:
Input:
vb Code:
Option Explicit Dim Something As StringMsgBox "Hello, world!"
Output:
HTML Code:
<div class="vbCode">
<span class="keyword">Option Explicit</span><br /><br />
<span class="keyword">Dim </span>Something <span class="keyword">As </span> String<br />
MsgBox <span class="string">"Hello, world!"</span><br />
</div>
Now, I'm not asking someone to write this for me, but for some reason I'm having a hard time with it. Can someone write some pseudo/logic-code or something that I can base my code off of?
Can Someone Convert Code From Delphi To VB6
var
MainForm: TMainForm;
implementation
uses StrUtils;
{$R *.dfm}
procedure TMainForm.FormShow(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
if Reg.OpenKey('SoftwarePaltalk',False) then
begin
Reg.GetKeyNames(UsersCombo.Items);
if UsersCombo.Items.Count>0 then
UsersCombo.ItemIndex := UsersCombo.Items.IndexOf(Reg.ReadString('cur_user'));
Reg.CloseKey;
end;
Reg.Free;
SerialLabel.Caption := GetVolumeSerial;
UsersComboChange(Self);
end;
function TMainForm.GetVolumeSerial: string;
var
SerialNo: Cardinal;
Tmp: Cardinal;
begin
GetVolumeInformation('C:',nil,0,@SerialNo,Tmp,Tmp,nil,0);
Result := IntToHex(SerialNo,8);
end;
procedure TMainForm.UsersComboChange(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.OpenKey('SoftwarePaltalk'+UsersCombo.Text,False);
EncPassLabel.Caption := Reg.ReadString('pwd');
Reg.CloseKey;
Reg.Free;
DecPassLabel.Caption := GivePassword(UsersCombo.Text,EncPassLabel.Caption,SerialLabel.Caption);
end;
function TMainForm.GivePassword(UserName, EncPass,
VolumeSerial: string): string;
var
i,j,k: Integer;
MixedUserSerial: string;
begin
while (Length(UserName)+Length(VolumeSerial)>0) do
begin
if Length(UserName)>0 then
begin
MixedUserSerial := MixedUserSerial + LeftStr(UserName,1);
Delete(UserName,1,1);
end;
if Length(VolumeSerial)>0 then
begin
MixedUserSerial := MixedUserSerial + LeftStr(VolumeSerial,1);
Delete(VolumeSerial,1,1);
end;
end;
i := Length(MixedUserSerial);
MixedUserSerial := MixedUserSerial + MixedUserSerial + MixedUserSerial;
j := 0;
while Length(EncPass)>0 do
begin
k := StrToInt(LeftStr(EncPass,3));
Delete(EncPass,1,4);
k := k - j - $7A - Byte(MixedUserSerial[i]);
Result := Result + Char(k);
Inc(j);
Inc(i);
msgbox "SS"
end;
end;
end.
Convert Code From Delphi To VB6
unit MainUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Registry;
type
TMainForm = class(TForm)
UsersCombo: TComboBox;
Label3: TLabel;
SerialLabel: TStaticText;
EncPassLabel: TStaticText;
DecPassLabel: TStaticText;
procedure FormShow(Sender: TObject);
procedure UsersComboChange(Sender: TObject);
private
{ Private declarations }
function GetVolumeSerial: string;
function GivePassword(UserName, EncPass, VolumeSerial: string): string;
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
uses StrUtils;
{$R *.dfm}
procedure TMainForm.FormShow(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
if Reg.OpenKey('SoftwarePaltalk',False) then
begin
Reg.GetKeyNames(UsersCombo.Items);
if UsersCombo.Items.Count>0 then
UsersCombo.ItemIndex := UsersCombo.Items.IndexOf(Reg.ReadString('cur_user'));
Reg.CloseKey;
end;
Reg.Free;
SerialLabel.Caption := GetVolumeSerial;
UsersComboChange(Self);
end;
function TMainForm.GetVolumeSerial: string;
var
SerialNo: Cardinal;
Tmp: Cardinal;
begin
GetVolumeInformation('C:',nil,0,@SerialNo,Tmp,Tmp,nil,0);
Result := IntToHex(SerialNo,8);
end;
procedure TMainForm.UsersComboChange(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.OpenKey('SoftwarePaltalk'+UsersCombo.Text,False);
EncPassLabel.Caption := Reg.ReadString('pwd');
Reg.CloseKey;
Reg.Free;
DecPassLabel.Caption := GivePassword(UsersCombo.Text,EncPassLabel.Caption,SerialLabel.Caption);
end;
function TMainForm.GivePassword(UserName, EncPass,
VolumeSerial: string): string;
var
i,j,k: Integer;
MixedUserSerial: string;
begin
while (Length(UserName)+Length(VolumeSerial)>0) do
begin
if Length(UserName)>0 then
begin
MixedUserSerial := MixedUserSerial + LeftStr(UserName,1);
Delete(UserName,1,1);
end;
if Length(VolumeSerial)>0 then
begin
MixedUserSerial := MixedUserSerial + LeftStr(VolumeSerial,1);
Delete(VolumeSerial,1,1);
end;
end;
i := Length(MixedUserSerial);
MixedUserSerial := MixedUserSerial + MixedUserSerial + MixedUserSerial;
j := 0;
while Length(EncPass)>0 do
begin
k := StrToInt(LeftStr(EncPass,3));
Delete(EncPass,1,4);
k := k - j - $7A - Byte(MixedUserSerial[i]);
Result := Result + Char(k);
Inc(j);
Inc(i);
msgbox "SS"
end;
end;
Convert DLL Into Vb6 Source Code
Hi,
I missed my visual basic 6 source code . but i have DLL file of the source code.
Help me.. how do you convert DLL into source code. is it possible in vb6?
I have vb decomplier lite software. but it wont convert source code format.
Regards
selva
Convert Delphi Code To VB
Hi,
I want to convert the following functions in vb. Please help me..
v_MapName: String;
v_MapHandle: THandle;
v_AppListHandle: THandle;
v_MapPointer: PChar;
v_AppListPointer: PChar;
v_MapMaxSize: Longword;
v_AppListMaxSize: Longword;
v_MapMessageID: Cardinal;
v_AppListMessageID: Cardinal;
v_ApplicationHandle: Cardinal;
v_IsMapOpen: Boolean;
v_IsMapLocked: Boolean;
v_ReadingAppList: Boolean;
v_AppListAlreadyExist: Boolean;
v_MapReadingInProgress: Boolean;
v_MutexHandle: THandle;
v_MapStrings: TStringList;
v_AppListStrings: TStringList;
function TfrmMain.open_FileMap : Boolean;
function openAFileMap(aMapName: String;
aMapNameSuffix: String;
var aMapHandle: THandle;
var aMapPointer: PChar;
aMaximumSizeLowOrder: Cardinal;
var aMessageID: Cardinal;
var aExists: Boolean) : Boolean;
var
iWindowMessage: array[0..255] of Char;
begin
Result := False;
// Let's open a named file mapping object backed by the
// operating sytem paging file (hFile = $FFFFFFFF)
aMapHandle := CreateFileMapping($FFFFFFFF,
nil,
PAGE_READWRITE or
SEC_COMMIT or
SEC_NOCACHE,
0,
aMaximumSizeLowOrder,
PChar(aMapName));
// Was the file mapping object creation successfull?
if ((aMapHandle = INVALID_HANDLE_VALUE) or (aMapHandle = 0)) then // No
RaiseLastWin32Error
else begin // Yes
aExists := ((aMapHandle<>0) and (GetLastError=ERROR_ALREADY_EXISTS));
// Let's map a view of the file into the address space of the calling
// process
aMapPointer := MapViewOfFile(aMapHandle, FILE_MAP_ALL_ACCESS, 0, 0, 0);
// Was the view of the file properly mapped?
if (aMapPointer = nil) then // No
RaiseLastWin32Error
else begin // Yes
// Let's copy a Pascal-type string into a null-terminated string
StrPCopy(iWindowMessage, aMapName + aMapNameSuffix);
// Let's define a new window message that is guaranteed to be unique
// throughout the system
aMessageID := RegisterWindowMessage(iWindowMessage);
// Was the message successfully registered?
if (aMessageID = 0) then // No
RaiseLastWin32Error
else // Yes
Result := True;
end;
end;
end;
var
iExists: Boolean;
begin
Result := False;
v_MapName := 'VisionProducts-EPIC$$EBM$$TM'; // Type: String
v_MapMaxSize := 512; // Type: Longword
v_AppListMaxSize := 4096;
v_MapHandle := 0; // Type: THandle
v_AppListHandle := 0;
v_MapPointer := nil; // Type: PChar
v_AppListPointer := nil;
v_MapReadingInProgress := False; // Type: Boolean
v_AppListAlreadyExist := False;
v_ReadingAppList := False;
v_IsMapLocked := False;
v_IsMapOpen := False;
v_MapStrings := TStringList.Create;
v_AppListStrings := TStringList.Create;
with v_AppListStrings do begin
Sorted := True;
Duplicates := dupIgnore;
OnChange := changesInAppListStrings;
end;
v_ApplicationHandle := Handle;
// If the main map (the "sharing" map) does not exist or is not open,
if (v_MapHandle = 0) and (v_MapPointer = nil) then begin
// Let's create/open it
if (openAFileMap(v_MapName, '-Synch-Now', v_MapHandle, v_MapPointer,
v_MapMaxSize, v_MapMessageID, iExists)) then begin
// Let's create a named mutex object used for interprocess
// synchronization
v_MutexHandle := Windows.CreateMutex(nil, False,
PChar(v_MapName + '.mtx'));
// Was the creation of the named mutex successful?
if (v_MutexHandle = 0) then // No
RaiseLastWin32Error;
// Let's create/open a second map that holds a list of all the
// applications sharing the main map
if (openAFileMap(v_MapName + '-AppList', '-Handles',
v_AppListHandle, v_AppListPointer,
v_AppListMaxSize, v_AppListMessageID,
v_AppListAlreadyExist)) then begin
Result := True;
v_IsMapOpen := True;
// If the map holding the list of applications sharing the main map
// was created by another application
if (v_AppListAlreadyExist) then
// Let's read the list of applications sharing the main map
readAppListMap;
// Let's add the current application to the list of applications
// sharing the main map
v_AppListStrings.Add(IntToStr(v_ApplicationHandle));
// If the map holding the list of applications sharing the main map
// was created by another application
if (v_AppListAlreadyExist) then
// Let's read the content of the main map
read_FileMap
// Otherwise,
else
// Let's assign the content of the sharable TStringList to the map
write_FileMap;
end;
end;
end;
end;
Help Convert DAO Function(Code) To -> ADO ?
hi guys,
im using this DAO Code
Quote:
VB Code:
Function NextJN()On Error Resume Next Dim NewNum As BooleanDim searchtr, lastnum, NextNum As StringDim X As Integer NewNum = True rsLogbook.MoveLaststrJNum = rsLogbook.Fields("JNumber")lastnum = rsLogbook.Fields("JNumber"): lblJNumShow.Caption = rsLogbook.Fields("JNumber")lblJNum.Caption = Str(Val(lastnum) + 1)lblLastNum.Caption = lastnum NextNum = Trim(lblJNum.Caption) If Len(Trim(lblJNum.Caption)) < 5 Then For X = 1 To (4 - Len(Trim(lblJNum.Caption))) NextNum = "0" & NextNum Next XNextNum = "SSS/" + Trim(NextNum) + "/" + Format(Date, "YY")End If strJobNumber = NextNum Exit FunctionEnd Function
can i how can i convert this one using ADO? thanks!
-
Convert Code From Delphi To Vb
hello, i would like to ask how to convert delphi code into vb.. so here is the part of delphi file.. called INC File?
Code:
tbllookup1 : array [0..255] of byte=(
$FE,$D2,$1D,$6C,$41,$BA,$EA,$51,$87,$FC,$78,$5B,$47,$C7,$30,$C0);
how to convert this into vb?
br
What Sort Of Code Is This? And How To Convert It....
0,8C,52,34,6B,63,53,66,F7,8E,EF,E3,3A,7F,9B,EE,0D:
_0A,61,9F,75,99,06,1A,8B,FE,B5,55,96,0B,18,54,7B,0802D
i got this from a program that my friend gave me.... this is from the admin password file of a winxp computer.... how do you decrypt this?
Code To Convert XML Using XSL File
Hi all,
I have an XML file and I have the XSL file which I will use to convert the XML but what code do I write to make the conversion?
Thanks in advance
Carlos
|