Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VB Naming Convention


Remember the naming convention we learned about? It's in my head, but I'd like a link to a detailed article.

Anyone got a link? Thanks.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Naming Convention
I've just got a new job. In this company nobody cares about naming convention. In the same procedure you can find variables with names : sFirst as string, strSecond as string, Third$, lFourth as string and so on. We have a meeting scheduled for tomorrow to discuss this and similar problems. Could anybody give me any source for the most usefull naming convention system?
Thank you.
Vlad

Redderick Naming Convention
Hello Folks,

I used to have a document that outlined the use of the
Redderick naming convention. I can't seem to find that
document or any other documentation on the naming convention.
I am wondering if anyone out there may know where I can
find the Rfedderick naming convention. I wish to follow it
precisely to make my VB work more in turn with industry
standards for when I become employed as VB programmer.

Any suggestions?

Andrew

Naming Convention For The Sstab And A Misc. Question
I tried to look for this on my own instead of posting a simple question like this on the forum. I must be blind as a bat but I couldn't find it in the help or at any sites with hungarian notations.

Unless you haven't noticed the subject heading ,
What's the correct naming convention for the sstab control?

I might as well ask another quesiton to make this post worthwhile...

Is VB capable of supporting method overloading, similar to java?

I'm not so sure if I got the term right so I better describe it . This is where you create multiple methods with the same names but accepts different parameters. So when you call the method it will check which paramters you're passing and run the corresponding method. Does anyone know this? Or am I just confusing this with another language or concept? Does VB support this?

Microsoft Recommended Naming Convention For Sql Server
hi every one

 I need Microsoft Recommended Naming convention for Sql Server.

  if u know any links pls rply me.

Thanks

urs

mk_mur

Another Convention Other Than '
I know that you can have text not as code but as extra info with the ' before each line of text.

My question is how can you do this for multiple lines of text (ie. over a 100) because putting the ' would get quite annoying. Is there another convention that you can put a ' or something before the first line and after the last?

GUI Convention
Is there any convention for the captions of a form.. like should the start with the name of the program and then a colon...

The name of my program is B&Z

should i caption my forms as so.

B&Z: Log-In
B&Z: Menu

or just leave them all the same??

im not up to speed with conventional gui standards

Thanks for your input

Bad DLL Calling Convention
Hello,

I am using functions for a C++ DLL file in my Visual Basic program. I have declared them all in a module using the Declare command.

When I know run my program from the IDE I do get a error "Bad DLL calling convention" when I am trying to use the functions from this DLL. When I run the compiled EXE of my program everything works fine.

Does anybody know what could be the problem here?

Bad DLL Calling Convention
Code:
Private Sub Command1_Click()
Clipboard.Clear
DoEvents
Call keybd_event(vk_sbnapshot, 0, 0, 0)
DoEvents
End Sub
At the particular fiunction it is giving me the error "bad dll calling convention " at this statement
Call keybd_event(vk_sbnapshot, 0, 0, 0)

I have defined this as

Private Declare Function keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Const VK_SNAPSHOT As Byte = 44

Bad DLL Calling Convention - HELP
I am trying to use the IBM MQSeries - CMQB.bas module provided by IBM to connect and disconnect from MQ.

When I run in debug with Visual Studio it all works fine but once I deploy (using Package and Depolyment Wizard) to a target machine I get.

"Bad DLL calling convention"

I have tried then debugging on this machine and found that it is during the call to MQDISC as follows:

Public Sub closeMQ()
'Disconnect from MQM
If Hcon Then
MQDISC Hcon, CompCode, Reason
End If
End Sub

This is defined as:

Declare Sub MQDISC Lib "MQM.DLL" Alias "MQDISCstd@12" _
(Hconn As Long, _
CompCode As Long, _
Reason As Long)

Please help as it work fine on my machine but not on the client - argh!

Bad DLL Calling Convention
Hi,

I have the following declarations in c++ header file:

typedef void* MFRT_D_HANDLE_TYPE;

typedef unsigned long MFRT_CUS_ID_TYPE;

typedef enum
{
MFRTO_SYNC,
MFRTO_ASYNC
} MFRT_OPERATION_MODE_TYPE;

DLLEXPORT MFRT_STATUS_TYPE MFRT_RegisterCustomer(MFRT_CUS_ID_TYPE Customer);

DLLEXPORT MFRT_STATUS_TYPE MFRT_CustomerInit( const unsigned long qb_num, const TCHAR * szIn, const TCHAR * szCusP, const TCHAR * szCusI);

DLLEXPORT MFRT_STATUS_TYPE MFRT_GetEvent(MFRT_D_HANDLE_TYPE *hda, MFRT_OPERATION_MODE_TYPE mod);

Im trying to declare these functions in VB and call them, but i get the error "Bad DLL Calling convention".

My declarations are:

Public Declare Function MFRT_RegisterCustomer Lib "MFRTCus.dll" (ByVal Customer As Long) As Long

Public Declare Function MFRT_CustomerInit Lib "MFRTCus.dll" (ByVal qb_num As Long, ByVal szIn As String, ByVal szCusP As String, ByVal szCusI As String) As Long

Public Declare Function MFRT_GetEvent Lib "MFRTCus.dll" (ByRef hda As Object, ByVal mod As Long) As Long


Where did i go wrong?
Please help me.

Bad DLL Calling Convention
I'm using VB6pro in win98se and I get a "run-time error '49': Bad DLL calling convention" trying to run the following code.

Private Declare Sub srand Lib "msvcrt" (ByVal seed As Long)
Private Declare Function rand Lib "msvcrt" () As Long
Private Sub Form_Paint()
srand 1
Print rand()
End Sub

I know about Randomize and Rnd but I have a very specific reason I need to use srand and rand so that I can duplicate an existing program written in C. If you could help me or point me in the right direction I would greatly appreciate it.
Thanks in advance,
Shirl

Bad DLL Calling Convention
HI

I have declarated function :

Public Declare Function ISGetBMPDims Lib "_ISource.dll" Alias "_ISGetBMPDims" _
(ByVal hSource As Long, _
ByRef puWidth As Long, _
ByRef puHeight As Long, _
ByRef puBitDepth As Long, _
ByRef pDPIStruct As ISDPIStruct) As Boolean

for image dimension return, and used:

ISGetBMPDims hImgBuffer, srcImageWidth, srcImageHeight, lBits, pDPI

Hhy show error "Bad dll calling convention"???

What's wrong?

thank's for your help...

R.

Bad DLL Calling Convention
Ok you're probably thinking not one of these posts again, but before you hit the back button take a look at my problem below.

I have a function declared in C++

Code:
__declspec(dllexport) LRESULT LVLDSession (int flag,int LVLDVersion);


Which can be called in VB6 by

vb Code:
Public Declare Function LVLDSession Lib "LVLDSDK.dll" (ByVal flag as Integer, ByVal LVLDVersion as Integer) as Long


Which works fine, out of the IDE. With the IDE it obviously generates the Bad DLL Calling Convention error. But this isnt my problem

In C++

Code:
typedef struct LVLD_DATA_TAG
{
int autopilot; // 0=OFF, 1=DISCO, 2=not used, 3=CMD
} LVLDDATA,*PLVLDDATA;

__declspec(dllexport) LRESULT ReadLVLDData (PLVLDDATA pLVLDSharedData);


And this is how I declare it in VB6

vb Code:
Public Declare Function ReadLVLDData Lib "LVLDSDK.dll" (ByVal LVLD as LVLD_DATA_TAG) as Long Public Type LVLD_DATA_TAG    autopilot as IntegerEnd Type Private Sub Form_Load()     Dim LVLD as LVLD_DATA_TAG     ReadLVLDData (LVLD) End Sub


This doesnt work and crashes the program with no error, any suggestions?

Thanks

Craig P

Coding Convention
what is the best coding convention that can be followed with vb?

Bad DLL Calling Convention
hi,
I am using following code to create a batch file.
I am getting error while closing the filehandle.

VB Code:
strFileName = "C:RegFiles.bat"lngTemp = CreateFile(strFileName, GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, sa, CREATE_ALWAYS, 0, 0)Call CloseHandle(lngTemp) 'Error: Bad DLL calling convention  

Does anybody know the reason?
Thanks in advance.

BAD DLL Calling Convention???
I wrote a simple DLL in assembler and am trying to call it from VB, but am gettinga badd calling convention error.

What is the correct way to setup the Declare statement for use with a DLL??

Thanks for any help.

Bad DLL Calling Convention ???
I am trying to use the icq api but am getting this error message when I try to use one of the function.

The function set wich of MY functions (In my app) will be called when a certain notification from ICQ arrives...

here goes..
Now the documentation for the ICQ API is written for C++, I have managed to convert most of them but maybe this one is not converted correctly ?

What the documentation says:

Code:
void WINAPI ICQAPIUtil_SetUserNotificationFunc(UINT uNotificationCode, void *pUserFunc);


In a module:

Code:
Public Declare Function ICQSetUserNotificationFunc Lib "ICQMAPI.dll" Alias "ICQAPIUtil_SetUserNotificationFunc" (uNotificationCode As Integer, ByVal pUserFunc As Variant)



In the code of a form:

Code:
Call ICQSetUserNotificationFunc(1, AddressOf ICQOnlineListChange)


Is the function converted correctly ? if it is, what is the problem. If not , How should it be?

Bad DLL Calling Convention
I'm trying to use a DLL, but when I try to run it from Visual Basic by
going to Run > Start I get a 'Bad DLL Calling Convention' error when I
try to access a function inside the DLL. If I compile the program to
an executable and run it everything works fine....that is I don't get
the 'Bad DLL Calling Convention' and the function works as it's
supposed to. Does anybody have any idea what is wrong. Thanks This
is the calling convention used in the DLL:

extern "C" __declspec( dllexport ).

Bad DLL Calling Convention
When this error message appears in API cals - it means wrong parameters or wrong using ByVal and ByRef. But this jumps out on 'End Sub' in Visual Basic! Has anybody been there before?

Preference Vs Convention
Which function do you prefer?

Code:
private sub foo()
  if a then
    if b then
      if c then
        if d then
          e
        end if
      end if
    end if
  end if
end sub


or

Code:
private sub foo()
  if not a then: exit sub
  if not b then: exit sub
  if not c then: exit sub
  if not d then: exit sub
  e
end sub


Assume you cannot say "If a and b and c and d then" since VB does not to my knowledge implement boolean short circuiting, meaning if a is false then b, c, and d are run irregardless and if b, c, or d assume a is true then your program crashes.

Which is better?

Bad Dll Calling Convention
    hi all,

im using the following code to determine if the mouse is over a certain point and if its being clicked. (note that the IsMouseDown function is a boolean function written by me, which causes no probs)

    Code:
    Dim ind As Integer
    If IsMouseDown = True Then
    For ind = 1 To Picture1.Count
    GetWindowRect picture1(ind).hwnd, Rec
    GetCursorPos PointPos
    If PointPos.x > Rec.Right And PointPos.x < Rec.Left Then
    If PointPos.y > Rec.Top And PointPos.y < Rec.Bottom Then
    picture1_Click (ind)
    End If
    End If
    Next ind
    End If
    

i get an error (49, bad dll calling convention) when i try to call GetWindowRect.
so i tried this.

    Code:
    Dim ind As Integer
    Dim pic As Long
    If IsMouseDown = True Then
    For ind = 1 To Picture1.Count
    pic = Picture1(ind).hwnd
    GetWindowRect pic, Rec
    GetCursorPos PointPos
    If PointPos.x > Rec.Right And PointPos.x < Rec.Left Then
    If PointPos.y > Rec.Top And PointPos.y < Rec.Bottom Then
    picture1_Click (ind)
    End If
    End If
    Next ind
    End If    
    

this gives the same error at the same place, so im kinda runnin out of ideas.

any help is appreciated.

Bad DLL Calling Convention
Hello..,

I am using a DLL in vb which is written in vc++.I am getting an error message saying Bad Dll Calling Convention..Error '49'. In my DLL i am using __declspec for import and export..
Anybody have idea about this?Please help me..


Thanks in advance,
Poornima.

Extention Name Convention
I have installed a text file (.txt) into program directory. Even tho it's a text file, I do not wish to have user opening and messing up this file.
What is the convention of renaming the extention so as to avoid problems. Can I rename it to xxxxx.dll without future problems.

Bad DLL Calling Convention
Hi, I am using VB 6 SP5.

I wrote a VB program that I compiled as a DLL named RFCECONV.DLL. The DLL contains a Function named Start_Conversion. The function header id:

Public Function Start_Conversion(WichCoder As Integer, InputData As String, DataSize As Long, CryptKey As String) As Long

The calling program (also written in VB) has the following declaration:

Private Declare Function Start_Conversion CDecl Lib "RFCECONV.DLL" (ByVal CodeType As Integer, ByVal InputData As String, ByVal InputSize As Long, ByVal CryptKey As String) As Long

and the call is coded as:

Dim CompReturn As Long
CompReturn = Start_Conversion(Call_Type, InputData, DataSize, Crypt_Key)

The variables are defined:

Private Call_Type As Integer
Private InputData As String
Private DataSize As Long
Private Crypt_Key As String

When I try to execute the Function call I get:

Run-time error '49'
Bad DLL calling convention

Anyone have any idea what I am doing wrong?

Bad DLL Calling Convention..Going Mad!
I have this:

Private Declare Function MyDllFunction LIB "MyDll" ( ByRef Value as Long ) As Long

I call it like this:

Dim myValue as long
myValue = H4000000
myValue = MyDllFunction( myValue )

I get runtime error #49 'Bad Dll Calling convention'

I am calling a C++ function that looks like this
long MyDllFunction( const long& value );

Why do I get this error???

Bad DLL Calling Convention, Please Help..
I'm not a VB Expert, but I would like to know what the hell is the error here.

My C++ DLL is declared this way:


extern "C" __declspec(dllexport) int PublishPDF(int Version, LPSTR source, LPSTR destination, int delai);




And my VB declare is:


private Declare Function PublishPDF Lib "PubPDF" (byval Version as Integer, byval Source as string, byval Destination as string, byval Delay as Integer) as Integer




And Visual Basic returns me a "bad calling convention" error (runtime error #49).. this is only happening at design time.

Thank you in advance, I'm lost here...!



---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.

VB Coding Convention
Is ther any document on the WEB about VB coding conventions?

Bad DLL Calling Convention
I sometimes receive the error message "Bad DLL calling convention" when one of my ordinary VB functions is called.
The function call is:
SendNotification(1)

The function prototype is:
Public Function SendNotification(ByVal MailType as Integer, Optional ByVal tNum as Integer) as Boolean

Are there any memory-leak issues or other environmental problems that could be causing this?

By the way, this code is in VBA as part of an Access XP database. (The function is in a separate module.)

Thanks for any help.

Bad DLL Calling Convention.. Important
I need to call a DLL, but the only problem is that i dont need to send any values by reference or by value... and i dont even need to retirieve any data.. Its giving the following error..
"Bad DLL Calling convention"..



anis
"Miles to Go Before I Sleep!!........."

Bad DLL Calling Convention Error Please Help!
Hi all,
Iam trying to call a C++ DLL from my VB code.
The C++ Dll is declared as:

CLIAPI int ClCaptureSnap(unsigned char * imgBuff, unsigned int * imgSize, HWND hwndParent, BOOL bShowVideoWindow);

This is to get an image from a camera Where,
imgBuff - user-allocated buffer to receive the face image (standard jpeg)
imgSize - receives actual size captured. pre-initialized to size of buffer
HWND - handle to the video capture window's parent - currently this parameter is ignored and should be set to NULL
bshowVideoWindow - true/false value; denotes whether video window will be shown - currently ignored - live video will be displayed

In Visual Basic I declare it as :

Declare Function ClCaptureSnap Lib "VisualCAPI.dll" Alias "?ClCaptureFace@@YAHPAEPAIPAUHWND__@@H@Z" ( _
ByRef imgBuff As Byte, _
ByRef imgSize As Long, _
ByVal hwndParent As Long, _
ByVal bShowVideoWindow As Long) As Long


The alias I got from the dump. Everything seems to work right but after I take a snap it says ERROR 49: Bad DLL calling convention.

Now, My VB code is as follows:

Private Sub Command1_Click()
Dim bytBuffer(30000) As Byte
Dim lngBufferSize As Long
Dim lngResult As Long
Dim showVideoWindow As Long
showVideoWindow = 0
lngBufferSize = 30001
lngResult = ClCaptureSnap(bytBuffer(0), lngBufferSize, 0, showVideoWindow)
MsgBox lngBufferSize
End Sub

Any help would be greatly appreciated. Thanks in advance!

M

[VB6]Convention Of Program Writting.
Hello everybody !

I ask your advise because I'm searching for a good manner to write my programs in VB6,do you have some advices for me to how write my code to be easy readable ? at this moment i write like this:

For private or public data members:
m_Variable
For variables used in a procedure only:
l_Variable
For variables passed in argument to a procedure:
a_Variable

If you have remarks or advices, don't hesitate to telle that to me Please !

Thanks a lot !

Connection Detection Convention?
I have two questions regarding detecting various types of connections. First of all, I am using InternetOpenUrl method of detecting an internet connection. I am opening a site that is very likely to be up, such as yahoo.com, but the problem is that it takes a very long time to detect if the connection is not there. I want to reduce this time. I do not think there is anyway directly with the InternetOpenUrl to lessen this time, but is there some place in the registry where the time out interval could be reduced? Secondly, I have seen plenty of examples on how to detect an internet connection, but does anyone have a reliable way of detecting whether a computer is connected to the network or not? Thank you very much for any help you can give.

Joe

'bad Dll Calling Convention' Error
Hi,

I have a problem calling an external function.

I get the mesage:

Run-time error '49'
Bad DLL calling convention

This is a piece of the coding:

Private Declare Function swe_set_topo Lib "swedll32.dll" _
Alias "_swe_set_topo@24" ( _
ByVal geolon As Double, _
ByVal geolat As Double, _
ByVal altitude As Double _
)


Call swe_set_topo(8#, 47#, 1#)

Can anyone tell me what i do wrong.
I how no experience using DLL's and dll calls.

thnx

Error 49 Bad Calling Convention
I heard people getting Bad Calling Convention Error on the CallWindowProc API call, windows 98

Can someone please tell me why ( i dont get the error , win2k ) and how i can get round it?

DLL Calling Convention Prob
My friend had written a DLL with C from which we are calling some functions in VB. The following is the code we're using but every time it gives us runtime errors - 'DLL Calling Convention Error'..

Can anyone enlighten us?


Code:
Global flagName As String

Public Declare Function getFlagState Lib "edrlib" (ByVal flagName As String) As Long


Private Sub Form_Load()
e = getFlagState(flagName) 'error here
End Sub



Even any little pointers?? Is the problem in our DLL - it may be to do with the string data type...

Cheers!
Mafro

[Edited by Mafro on 05-26-2000 at 10:27 AM]

Database Fields Convention!! Pls Help
Hi All

I was wondering if u can help...i don't even know if i posting this question in the right forum but here it goes!

What is the convention when writing fields in a database!

Would it be something like 'ID ' or more like customer_ID?

Any help would be valuable!!

Tahnks
Nick

GetLocalTime - Bad Dll Calling Convention?
Hi guys.

I had taken a look at a post on how to get the local time from the system and have tested the code out and I received a bad dll calling convention from the IDE. Here's what I have so far:

Code:
In a module:

Public Declare Function GetLocalTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME)

Type SYSTEMTIME
  wYear As Integer
  wMonth As Integer
  wDayOfWeek As Integer
  wHour As Integer
  wMinute As Integer
  wSecond As Integer
  wMilliseconds As Integer
End Type

In the form:
dim xTime as SYSTEMTIME
' I left in only the hour, minute, and seconds
lblClock.Caption = _
Chr(32) & xTime.wHour & ":" & xTime.wMinute & ":" & xTime.wSecond


If anyone can see something that may not be right that would be super. Thanks for your time.

RJ

Bad Dll Calling Convention (error 49)
Hi,
I have an error 49 trying to share a drive from VB 6. I use the following declarations:
Public Const CONNECT_UPDATE_PROFILE = &H1
Public Const RESOURCE_GLOBALNET = &H2
Public Const RESOURCEDISPLAYTYPE_SHARE = &H3
Public Const RESOURCEUSAGE_CONNECTABLE = &H1

Public Type mcNetResource
   mcScope As Long
   mcType As Long
   mcDisplayType As Long
   mcUsage As Long
   mcLocalName As String
   mcRemoteName As String
   mcComment As String
   mcProvider As String
End Type

Public Enum mcNetType
    mcany = 0
    mcDisk = 1
    mcPrint = 2
End Enum
Private Declare Function WNetAddConnection3 Lib "mpr.dll" Alias "WNetAddConnection3A" (ByVal hWnd As Long, lpNetResource As mcNetResource, ByVal lpPassword As String, ByVal lpUserName As String, ByVal vFlags As Long)

Then the relevant code goes:

    i = MapNetDriveA("C:SMBWA", "f", , , 0, True)

Public Function MapNetDriveA(ByVal vPath As String, ByVal vDrive As String, Optional ByVal vUserName As String = vbNullString, Optional ByVal vPassword As String = vbNullString, Optional ByVal vFormHwnd As Long = 0&, Optional vPermConnect As Boolean = False) As Long

Dim Flags As Long
Dim NetResType As mcNetResource

         MapNetDriveA = 0
        If MapNetDriveA Then
            With NetResType
                .mcLocalName = vDrive
                .mcRemoteName = vPath
                .mcType = mcDisk
                .mcScope = RESOURCE_GLOBALNET
                .mcDisplayType = RESOURCEDISPLAYTYPE_SHARE
                .mcUsage = RESOURCEUSAGE_CONNECTABLE
            End With
             
            If vPermConnect Then Flags = CONNECT_UPDATE_PROFILE
         
            MapNetDriveA = WNetAddConnection3(vFormHwnd, NetResType, vPassword, vUserName, Flags)

When I get to the last line the program fails with the error in this post title. Can anybody clarify the problem for me?
Thanks in advance...

Error: Bad Calling Dll Convention
hi you all doing

i have a dll defined like this in access module

Public Declare Function GenerateLicenceID Lib "C:Finalinvproc.dll" Alias "?GenerateLicenceID@@YA?AVCString@@V1@H@Z" (sBaseID As String, duration As Integer) As String


than i have a function that calls it in one of the forms

Dim SerKey As String
Dim UnKey As String
Dim sTerm As Integer

sTerm = [Term].Value
SerKey = [Lic_Key].Value

UnKey = GenerateLicenceID(SerKey, sTerm)

[Unlock_Key].Value = UnKey

but as i run it i get bad calling dll convention

i use the alias feature because that is how it is called after exporting it in c++

Convention Of Calling DLL Not Valid
if i use my dll in a program,in running,the pc gives me this error "Convention of calling dll not valid"
with another program, program goes ok.
is there someone who can help me?any suggestion?
thanks,Isabella

Urgent: Bad DLL Calling Convention
Hi, am calling a dll function from my vb code (exe server). When I use my vb exe server in some other application, error pops up with just a number -11. If I debug my vb server exe I get "Bad dll calling convention, runtime error 49" error. According to my investigation, Arguments passed to adynamic-link library (DLL) must exactly match those expected by the routine. In my case, API function accepts long and I am passing integers. Should this be a problem? Or please let me know if am missing something??

khushia.

Bed Dll Calling Convention From VB App To VC Dll Function
I am getting error Bed Dll Calling Conveyantion from VB Application when i call a function written in VC++ Dll as standerd C like function

If i run it as exe application their is no error

with the same perameter binding working fine,
error come at the time of exit from VC++ Function

Bad Dll Calling Convention With Odbc Api
I am using the folling odbc api function


RETCODE SQLInstallerError(
WORD iError,
DWORD * pfErrorCode,
LPSTR lpszErrorMsg,
WORD cbErrorMsgMax,
WORD * pcbErrorMsg);



RETCODE is a C-Integer type. In my VB file I have the following declaration:


private Declare Function SQLInstallerError Lib "odbccp32" _
(byval iError as Long, byval pfErrorCode as Double, _
byval lpszErrorMsg as string, byval cbErrorMsgMax as Long, _
byval pcbErrorMsg as Long) as Long




Here is my sample code:

private Sub ShowSQLError()
Dim lpszErrorMsg as string
Dim sqlErrorMsg as string
Dim sqlError, iError, cbErrorMsgMax, pcbErrorMsg as Long
Dim pfErrorCode as Double
sqlErrorMsg = "Undefined error"

sqlError = SQLInstallerError(iError, pfErrorCode, lpszErrorMsg, _
cbErrorMsgMax, pcbErrorMsg)




That is all the farther it makes it. When it processes that last line at run-time I get a bad dll calling convention. Any help on how to fix this?

-K

Error 49 (Bad DLL Calling Convention).
I'm calling a C DLL from VB when I get the above error. I've rechecked the syntax of the prototype and have found nothing wrong. Any ideas about what might be causing this?

Strange Function Calling Convention
Hi, I have search high and low and I can’t find the answer to this question.

I only know vb.net and at the moment I am learing VBA for a CAD system I am using.

Through out the tutorials they are using a really strange format for calling functions

Eg:

Code:Dim myObject as AnObject

With myObject

.SomeFunction argument1, argument2 argument3

End With

As you can see there are know brackets! Intellisence shows bracket but if I put then in I get an error.

I am assuming that this is not VBA specific

Whats that all about!

Talyrond

WindowFromPoint - Bad DLL Calling Convention (run-time Error 49)
With the following declaration:

Code:
Private Declare Function WindowFromPoint Lib "user32" ( _
ByVal PointX As Long, _
ByVal PointY As Long _
) As Long
WindowFromPoint works fine...
But when using WindowFromPoint in this format:

Code:
Public Type POINT_API
X As Long
Y As Long
End Type
Private Declare Function WindowFromPoint Lib "user32" ( _
Point As POINT_API _
) As Long
Run-time error 49 (Bad DLL calling convention) pops up. why?

Error 49. Bad DLL Calling Convention. [GEEKTRESTING RESOLUTION]
Hi.

I am getting this strange error which has me stumped. I have no idea how I have caused this, or how it is connected with DLLs.

The function is called with the two parameters and all the code inside works fine. The error occurs when the End Sub is reached and it tried to return to the calling function.
Code:' The line that causes the error.
Call xml_extract_diagram_functional_elements(functionalNode, diagramElementBlockNumber) ' The line that causes the error.

' The function prototype.
Private Sub xml_extract_diagram_functional_elements(ByRef functionalNode, ByRef diagramElementBlockNumber)
' Stuff
End Sub
Apart from the implicit DLLs that VB uses I have no explicitly invoked any other DLLs in my application. To be honest I don't even know how.

Can anybody shed any light on the possible causes for this error?

>> I found out what it was. It seems I was ReDim-ing an array of UDTs inside the function without adding the "As myUdtType". This cause the interpreter to add memory space of some default size (guessing variant), that was smaller than my UDT size. Then when I populate the UDT it overuns the variant-sized allocation and corrupted the stack. Still, all sortd now. Naughty compiler not catching that!



Edited by - Steven_Cox123@yahoo.com on 9/4/2003 6:48:40 AM

Tab Naming
I am making a options form and i have 4 tabs. how to i set captions for each one? also how do i have each tab have different info and options to choose from.

thanks
turtleman14789

Naming Ranges
Hi all,

I am trying to create range names for a large number of ranges, in order to do so I am using the createnames function and pulling the name from the row to the left. That is all working fine but I am trying to also add a suffix to the range name (i.e. _MTD). Below is my code along with the results and desired results, I have been unable to get it to work so any help would be appreciated.
Kevin

Sub Range_Name()
Set rangetoName = Worksheets("Queries").Range("A26:B37")
rangetoName.CreateNames Left:=True
End Sub

Result: Other_Income
Desired Result: Other_Income_Mtd

Copyright © 2005-08 www.BigResource.com, All rights reserved