Results 1 to 7 of 7

Thread: compiling dll problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    compiling dll problem

    hi, im trying to compile a simple dll but it gives me error.. i trying to create dll so that it can be referenced by vb6

    --------------------Configuration: mCodes - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    Compiling...
    mCodes.cpp
    C:\Program Files\Microsoft Visual Studio\MyProjects\mCodes\mCodes.cpp(332) : error C2440: '=' : cannot convert from 'char *' to 'unsigned char *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Program Files\Microsoft Visual Studio\MyProjects\mCodes\mCodes.cpp(334) : error C2664: 'strlen' : cannot convert parameter 1 from 'unsigned char *' to 'const char *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.

    mCodes.dll - 2 error(s), 0 warning(s)

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: compiling dll problem

    You're trying to convert a pointer to unsigned char to a pointer to plain char. That doesn't work. Your code is faulty.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: compiling dll problem

    fred = (unsigned char*)mychar;

    something like that cast might help.
    I don't live here any more.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: compiling dll problem

    Bad idea. Never cast unless you know for certain that it's justified. Careless casting away of conversion errors is an extremely bad habit to get into.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: compiling dll problem

    Fair point, I suggest it only in the absence of any code example that we can make a more informed suggestion upon.
    I don't live here any more.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: compiling dll problem

    @CornedBee

    could you help me in compiling?

    br

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: compiling dll problem

    Help you in compiling?

    How about you post the code that makes problems. As you can see from our discussion, our clairvoyance is not quite in tune.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width