Advertisement

Return Codes and Constants

Started by January 18, 2001 04:07 PM
0 comments, last by AlekM 24 years ago
Hi folks, I am developing an ATL class using Visual C++. I want to use this COM object within Visual Basic. My question is how can I set up my return codes as constants within VB. For example, in my VB code,
  

On Error Goto ErrorHandler

''My Code
.
.
.

ErrorHandler:
   Select Case Err.Number
            ''I want it to look like this
            Case ERR_BMP_PATHINVALID
                      ''Handle error
            ''And not like this
            Case 1000
                      ''Handle error
   End Select
End Sub

''where the following is true
ERR_BMP_PATHINVALID = 1000

  
Thanks Alek
I''m not much of a VB programmer but I think you''d do this:
  Public Const ERR_BMP_PATHINVALID = 1000  

Like in C++. Hope that helps.



My Geekcode: "GCS d s: a14 C++$ P+(++) L+ E-- W+++$ K- w++(+++) O---- M-- Y-- PGP- t X
R- tv+ b++ DI+(+++) D- G e* h!"
Decode my geekcode!
Geekcode.com


Visit our web site:
Asylum Entertainment
My Geekcode: "GCS d s: a14 C++$ P+(++) L+ E-- W+++$ K- w++(+++) O---- M-- Y-- PGP- t XR- tv+ b++ DI+(+++) D- G e* h!"Decode my geekcode!Geekcode.com
Visit our web site:Asylum Entertainment

This topic is closed to new replies.

Advertisement