Sign in to follow this  
Followers 0
jaberwacky

Noob VB question inside...

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

1 person likes this

Share this post


Link to post
Share on other sites

I'm not sure if you're complaining about having to use C/C++ or were disappointed in my answer.

Share this post


Link to post
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.  =)

Share this post


Link to post
Share on other sites

If you show me the links to these "answers" as you put it, I can clarify them for you.

I can also help you look up that constant if you need help with that too.

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0