Community discussion forum

Help with DLL

Tags: c++ Turkey
  • 8 months 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
     




     

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 8 months 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 "SOK" if the URL is valid and "SFALSE" 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?

  • 8 months 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


     

  • 8 months 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).