Conversion VC++6.0 vers VB6.0

cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008 - 10 déc. 2008 à 17:59
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008 - 11 déc. 2008 à 11:54
Bonjour à tous,

J'ai effectué pas mal de recherche sur le net pour trouver un convertisseur de code VC++6.0 vers VB6.0. Et je trouve toujours l'inverse!!! Je ne connais pas du tout le VC++6.0, et j'ai reçu un projet que je dois adapter pour VB6.0. Est-ce que quelqu'un pourrais m'aider svp. J'ai commencé la traduction, mais franchement je suis perdu.

D'avance, je vous remercie,

Bonne après-midi,

Iceberg.

3 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
10 déc. 2008 à 18:16
Normal que tu ne trouves pas de convertisseur C vers VB, ça n'existe pas.

ciao...
BruNews, MVP VC++
0
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008
11 déc. 2008 à 09:44
BruNews,

je te remercie pour l'information. Je vais me renseigner pour trouver des tableaux de conversion de déclaration de type, de fonctions du VC++ vers VB6.0.

Bonne journée,

Ice.
0
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008
11 déc. 2008 à 11:54
Yep, j'ai 2 fonctions que je n'arrive pas traduire de VC++6.0 vers VB6.0. Pouvez-vous m'aider svp.

Les voici :

void CTestDlg::ConvertBinaryToString (CString&    String,
                                         void*        pBinary,
                                         int        Length,
                                         bool        bHexData)
{
    union
    {
        void*    pBinary;
        LONG*    pLong;
        BYTE*    pByte;
    }        Data;
    TCHAR    szValue[16];
    int        Inx;

    Data.pBinary = pBinary;
    for (Inx = 0; (Inx < Length); Inx++)
    {
        // convert binary value to string value:
        if (bHexData)
            _stprintf (szValue, _T("%02x"), Data.pByte[Inx]);
        else
            _stprintf (szValue, _T("%u"), Data.pLong[Inx]);
        if (Inx < (Length - 1))
            _tcscat (szValue, _T(","));

        // add to string:
        String += szValue;
    }
}

int CTestDlg::ConvertStringToBinary (void*            pBinary,
                                        int                Length,
                                        const TCHAR*    szString,
                                        bool            bHexData)
{
    union
    {
        void*    pBinary;
        LONG*    pLong;
        BYTE*    pByte;
    }        Data;
    TCHAR*    pNextData;
    int        Inx;

    Data.pBinary = pBinary;
    for (Inx = 0; (Inx < Length); Inx++)
    {
        // skip non numeric characters:
        while ((*szString != _T('\0')) && (! _istalnum (*szString)))
            szString++;

        // test end of string:
        if (*szString == _T('\0'))
            break;

        // convert string value to binary value:
        if (bHexData)
            Data.pByte[Inx] = (BYTE) _tcstoul (szString, &pNextData, 16);
        else
            Data.pLong[Inx] = (LONG) _tcstoul (szString, &pNextData, 10);
        if (szString == (const TCHAR*) pNextData)
            break;        // -> invalid value
        szString = (const TCHAR*) pNextData;
    }

    return (Inx);    // -> number of converted values
}
0
Rejoignez-nous