NO

Author Topic: Bad DLL calling convention  (Read 4599 times)

MrTimmyToes

  • Guest
Bad DLL calling convention
« on: August 07, 2005, 11:48:46 PM »
A number of users I've spoken with have the issue when their VB6 application is run and they call a DLL made by Pelles C, a runtime error (49) reads "Bad DLL calling convention."  To solve this, you MUST compile your VB6 program into an executable (.exe).  If you try to call a DLL (for example a DLL made in Pelles C) from the VB6 IDE, you will get a "Bad DLL calling convention" error.  This has to deal with the way the IDE is debugging the VB6 program as it is running.

So simply put, make your VB6 code into an exe and then call your DLL made in Pelles C.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Bad DLL calling convention
« Reply #1 on: August 08, 2005, 09:33:40 PM »
And your bug report is.....??????????

In my experience any problems calling DLL's rarely have anything to do with Pelles C nor Visual Basic - but with the complete lack of knowledge by the average Visual Basic "programmer".

Pelle
/Pelle

Anonymous

  • Guest
Bad DLL calling convention
« Reply #2 on: August 08, 2005, 10:51:54 PM »
Quote from: "Pelle"
And your bug report is.....??????????

In my experience any problems calling DLL's rarely have anything to do with Pelles C nor Visual Basic - but with the complete lack of knowledge by the average Visual Basic "programmer".

Pelle


:wink:  Careful Pelle... Accustations of complete ignorance are best reserved for Delphi programmers.  :lol:

MrTimmyToes

  • Guest
Let us not start flames
« Reply #3 on: August 08, 2005, 11:14:16 PM »
Pelle,

I would agree the first message should have been put in Chit-Chat rather than bug reports.

I do not intend to start nor encourage flames, so I will be courtious about my response.

I would not believe I have a lack of knowledge about programming.  First, I am an assembly programmer.  I understand how data is passed between processes, but the C language is not my "bread and butter."  I'll typically use VB and Assembly to get the job done (using NASM).  I've only recently ran into the issue with DLL's and VB applications when written in Pelles C.  I'm still fairly new in regards to programming with the C language, which is probably what you meant; "...<U>complete</U> lack of knowledge by the 'newbie' C programmer." [a more accurate portrayal]

You can disregard your own statement about being a VB "programmer."

Tim

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Bad DLL calling convention
« Reply #4 on: August 08, 2005, 11:33:26 PM »
OK, OK, I'm sorry!

The background is that I have received at least 10 e-mails in the last ~ year from people who say they are programming in Visual Basic, have downloaded Pelles C and - by the sound of it - spent a full minute trying to build a DLL for VB. Failing to do so, they immediately assume the problem is with Pelles C.

I'm sorry again - I guess I'm a bit sensitive about this.

Pelle
/Pelle