system directory

Posted on 2002-03-12
Last Modified: 2010-05-02
how do u get the sytem directory?
Question by:killer5
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 52

Accepted Solution

Ryan Chong earned 5 total points
ID: 6859312

Author Comment

ID: 6859344
thanks ryancys!
but before i give u the points let me ask u one thing.

what's the difference between system and system32 folders?
can i use system32 to register my own ActiveX(ocx) files?
LVL 52

Expert Comment

by:Ryan Chong
ID: 6859381
Basically we just use either system or system32 to register your own ActiveX (ocx). So just register it to the path returned by this function and it will be fine.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 6859412
the code is not that optimized... it returns some weird characters. thanks anyway
LVL 52

Expert Comment

by:Ryan Chong
ID: 6859587
So i deserve a "C"?!
LVL 44

Expert Comment

ID: 6860009
i didn't do better in that other question ;) questioner would like to have more of cut & paste code completely tailored i guess
LVL 15

Expert Comment

ID: 6862767
There is a small error in that vbcode sample.

Original line:
    strWindowsSystemDirectory = Left$(strBuffer, Len(strBuffer) - 1)  ' weird character is Chr(0)
should be changed to:
    strWindowsSystemDirectory = Left$(strBuffer, lngReturn)

The function returns the length of the string returned if it is successful, or 0 if it failed.
    lngReturn = GetSystemDirectory(strBuffer, MAX_PATH)

Suggestion to still change the grade to B, since no info is lost, and 'weird character' is trimmed automatically in most cases, e.g if you show a MsgBox, or put it into textbox.  It will still show in IDE, when you move mouse over variable.
LVL 52

Expert Comment

by:Ryan Chong
ID: 6863186
Thanks ameba for clarification.

Expert Comment

ID: 6864872
Grade changed.


You should understand that here at Experts Exchange, you have the responsibility of bringing a question to an excellent resolution. Spend some time answering the experts questions and clarifying your problem. The experts have given their time in helping you, please show your appreciation by attending to your open questions and not grading punitively.

When you're grading an expert's answer it is important to remember that the grade you award to a question is a token of appreciation, not a "school" grade.

For grading, in general, I would advise to give an "A" unless you have a good reason to grade less, for example, if you asked for more information and you didn't get it, or the expert only gave you a starting point and you still had to do most of the grunge work yourself.

A "C" grade is particularly unacceptable if the person simply posted their suggestion as a comment. After all, you are not obliged to accept a comment as the answer.

Whatever the case may be, if you're considering giving a "B" or a "C", please tell the expert beforehand, so that they have a chance to work on making their answer worth that "A".

Another thing you might want to consider is that a lot of experts check an asker's grading record. If they see that an asker habitually grades questions with "B"s or even "C"s they would be very reluctant to give their help. With your current record, you might find it difficult to get good and timely answers.

Community Support Moderator
Experts Exchange

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question