Jump to content

Noob VB question inside...


Recommended Posts

Hello.  I want to find the value of this variable: LOCALE_NAME_MAX_LENGTH.  So I went searching the net but can't find it.  SO I thought I'd actually fire up my copy of Visual Studio Express.  So I created a form that has a textbox and a button that when clicked will display some text in the textbox.  Which works until I tell it to display the value of LOCALE_NAME_MAX_LENGTH.  Does anyone know where I went wrong?

Edit.  Sorry.

The errors are:

Error   1   'If', 'ElseIf', 'Else', 'End If', 'Const', or 'Region' expected.

Error   2   'LOCALE_NAME_MAX_LENGTH' is not declared. It may be inaccessible due to its protection level.

And the code is:

#include <Windows.h>

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox1.Text = LOCALE_NAME_MAX_LENGTH.ToString()
    End Sub
End Class

Tried putting the include inside the form1 class too.

Edited by jaberwocky6669
Link to comment
Share on other sites

VB.Net doesn't work even remotely like C++. Including a header file isn't valid in VB.Net.

It's also worth noting that LOCALE_NAME_MAX_LENGTH isn't a variable. It's a preprocessor directive and is treated as the literal value it represents. You need to actually write a C/C++ application to use it in a program, or search the headers for the directive manually.

Link to comment
Share on other sites

Oh, I was embarrased for such a dumb question.  Sorry for the confusion.  I should have clarified.  I don't mind having to use c++.  I don't have experience with visual c++ and so I'm not sure how different it is though.  I'll find out when I get there.  Thank you for taking the time to answer my question!  I did look up possible solutions but I'm pretty sure that I even found some "answers" which contradict yours.  I think those were jokes played on noobs though.  Thanks for not playing jokes on me.  =)

Link to comment
Share on other sites

I'm ok now, I forgot why I even needed that.  Lemme see, ... oh because I was interested in adding some functions to the UDFs till I found out that yashied had already beaten me to them with _WinAPIEX.

Thank you though, appreciate it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...