Help with DLL

cpp Turkey
  • 12 years ago

     Hello,

     I am using VS 2005 and need to create a simple DLL that accepts a string then passes the string through IsValidURL() and returns a 1 for a Valid URL and a 0 for a inValid URL.

     I apologize the last time I programed anything was VB and windows 3.x maybe 95.  It seems to have gotten exponentially more complex.

    Regards,

     Mike
     




     

  • 12 years ago
    Why do you want to reinvent the wheel? The DLL called "urlmon.dll" can do just that for you.

    Take a look at the documentation of "IsValidURL" and you will find that is returns "S_OK" if the URL is valid and "S_FALSE" otherwise.

    Instead of making yet another DLL you should convert the return value of "IsValidURL" to a "bool".

    I don't think it's worth creating another DLL just to make this trivial conversion?
  • 12 years ago

     Hi K++,

    Trust me, I don't what to reinvent the wheel?  My challenge is that IsValidURL needs the URL to be type LPCWSTR a single unicode.  I am programing in a language (EasyLanguage) that can't convert a string to a unicode.  How do I convert a string to a type LPCWSTR if my programing language can't do it.

     
    Thanks


     

  • 12 years ago

     To convert a string from ANSI to Unicode use the function "MultiByteToWideChar", give it "CP_ACP" code page, the string you want to convert, its length and a buffer where to put the resulting string. Once you have the string, pass it to "IsValidURL" function to do the work you want.

    If you still cannot do it, ask me so I will try to code it for you, but don't think it will be rapid, I have many things to do also.

    Nice day! 

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski