Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

OT: .DLL coded in Visual C++, called in VB6; HELP!

OT: .DLL coded in Visual C++, called in VB6; HELP!

2004-08-11 by jay marante

sorry for the OT but i really have a hard time making this program run. im new in VB.

i have a code done in VB6. now, i want to manipulate every element (character) of a string variable. i want to shift its bits to the left. my professor told me that it can't be done in VB, instead, he suggests to make a .DLL file in C++. i don't know anything about C++, but i have knowledge in C since i've been doing my AVR project.
what i did was, chose WIN32 DLL file, then chose simple DLL. i code my routine inside the .CPP file. and compile the program, and build the .DLL file, as what i can see under the PROJECT taskbar. now, i declared a module in VB where i put the declaration of the function and the .DLL file. i called the the function in my VB code but there's an error. it says "Can't find DLL entry point". what am i doing wrong?

attached is my code in C++. its supposed to get the string input in the text box in VB which will be send to the serial port, connected with a nokia phone, send its message to another mobile. before sending it to the com port, i have to manipulate its input. that's the reason for the .DLL file. just run the program. can somebody please help me. tips and smaples are highly appreciated. i tried to google the net but there are lots of examples and i don't know when to use them. and also, how am i going to declare and call it in VB?

thank a lot.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: [AVR-Chat] OT: .DLL coded in Visual C++, called in VB6; HELP!

2004-08-11 by Robert Adsett

At 03:25 PM 8/11/04 -0700, you wrote:
>sorry for the OT but i really have a hard time making this program run. im 
>new in VB.
>
>i have a code done in VB6. now, i want to manipulate every element 
>(character) of a string variable. i want to shift its bits to the left. my 
>professor told me that it can't be done in VB,

Before you get too hung up on this.  It is possible to shift in basic, it's 
just called multiply and divide.  A single left shift is a multiply by 2 
and a single right shift is a divide by 2.  That would save you the hassle 
of an interlanguage dll call.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: [AVR-Chat] OT: .DLL coded in Visual C++, called in VB6; HELP!

2004-08-11 by jay marante

i need to get every bit of every character and transfer it to the previous character. nokia phones only need 7-bits for a character. the 8th bit is taken from the next byte of the next character. for example in the first element of a string, the 8th bit of is masked, 0x7F, and the 8th bit will be occupied by the least significant bit of the next character. so the 2nd character will only have 6 bits remaining (since the 8th bit of it is, again, masked). to complete its 8 bits, the 7th and 8th bit of the second character will be occupied by the last two least significant bit of the 3rd character.  and the third character will only have 5 bits remaining (1 masked, 2 shifted to the previous byte). this is done until the last character that will be send. so we a right shifting bits in every data that will be sent.
 
 

Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
At 03:25 PM 8/11/04 -0700, you wrote:
>sorry for the OT but i really have a hard time making this program run. im 
>new in VB.
>
>i have a code done in VB6. now, i want to manipulate every element 
>(character) of a string variable. i want to shift its bits to the left. my 
>professor told me that it can't be done in VB,

Before you get too hung up on this.  It is possible to shift in basic, it's 
just called multiply and divide.  A single left shift is a multiply by 2 
and a single right shift is a divide by 2.  That would save you the hassle 
of an interlanguage dll call.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III


Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/AVR-Chat/
  
   To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Re: [AVR-Chat] OT: .DLL coded in Visual C++, called in VB6; HELP!

2004-08-11 by Robert Adsett

At 04:02 PM 8/11/04 -0700, you wrote:
>i need to get every bit of every character and transfer it to the previous 
>character. nokia phones only need 7-bits for a character. the 8th bit is 
>taken from the next byte of the next character. for example in the first 
>element of a string, the 8th bit of is masked, 0x7F, and the 8th bit will 
>be occupied by the least significant bit of the next character. so the 2nd 
>character will only have 6 bits remaining (since the 8th bit of it is, 
>again, masked). to complete its 8 bits, the 7th and 8th bit of the second 
>character will be occupied by the last two least significant bit of the 
>3rd character.  and the third character will only have 5 bits remaining (1 
>masked, 2 shifted to the previous byte). this is done until the last 
>character that will be send. so we a right shifting bits in every data 
>that will be sent.

Hmm. I would think off hand you would want to do both right and left 
shifting but in any case it  should be quite doable with appropriate use of 
multiply and divide by 2 and little masking with and and or (VB does 
support binary and and or doesn't it?).

IE a right shift by 3 would be a/8 or maybe a/(2^3)

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

RE: [AVR-Chat] OT: .DLL coded in Visual C++, called in VB6; HELP!

2004-08-12 by Felicity & Bruce

Hi,

I haven't played with VB but this may be worth looking at.
The above dll will be created with a C++ mangled export and VB may not
understand it.
To create the entry point with a standard C name add a .def file to the link
process.

Put this line in the project options for the link. ie.Use menu Project --->
Settings and select the LINK tab
/def:".\convert.def"

Create a def file in the source folder called CONVERT.DEF with the contents
LIBRARY CONVERT
DESCRIPTION 'Convert DLL'

EXPORTS
     _conv_8to7

Good luck...
Show quoted textHide quoted text
  -----Original Message-----
  From: jay marante [mailto:jaythesis@yahoo.com]
  Sent: Thursday, 12 August 2004 10:25 a.m.
  To: avr-chat@yahoogroups.com
  Subject: [AVR-Chat] OT: .DLL coded in Visual C++, called in VB6; HELP!


  sorry for the OT but i really have a hard time making this program run. im
new in VB.

  i have a code done in VB6. now, i want to manipulate every element
(character) of a string variable. i want to shift its bits to the left. my
professor told me that it can't be done in VB, instead, he suggests to make
a .DLL file in C++. i don't know anything about C++, but i have knowledge in
C since i've been doing my AVR project.
  what i did was, chose WIN32 DLL file, then chose simple DLL. i code my
routine inside the .CPP file. and compile the program, and build the .DLL
file, as what i can see under the PROJECT taskbar. now, i declared a module
in VB where i put the declaration of the function and the .DLL file. i
called the the function in my VB code but there's an error. it says "Can't
find DLL entry point". what am i doing wrong?

  attached is my code in C++. its supposed to get the string input in the
text box in VB which will be send to the serial port, connected with a nokia
phone, send its message to another mobile. before sending it to the com
port, i have to manipulate its input. that's the reason for the .DLL file.
just run the program. can somebody please help me. tips and smaples are
highly appreciated. i tried to google the net but there are lots of examples
and i don't know when to use them. and also, how am i going to declare and
call it in VB?

  thank a lot.
  __________________________________________________
  Do You Yahoo!?
  Tired of spam? Yahoo! Mail has the best spam protection around
  http://mail.yahoo.com
        Yahoo! Groups Sponsor
              ADVERTISEMENT







----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/AVR-Chat/

    b.. To unsubscribe from this group, send an email to:
    AVR-Chat-unsubscribe@yahoogroups.com

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.