Thread: dll issue

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    137

    dll issue

    i have a dll that keeps locking up when i call the function sock_init() and i have no idea why. i'll post the code and if anyone can answer i'll appreciate it.

    PHP Code:
    #include "dll.h"
    #include <windows.h>

    using namespace std;

    export double sock_init()
    {
        
    WSADATA w;
        
    int error WSAStartup(0x0202, &w);

        if (
    error)
        {
            
    WSACleanup();
            return (
    static_cast<double>(0));
        }

        if (
    w.wVersion != 0x0202)
        {
            
    WSACleanup();
            return (
    static_cast<double>(0));
        }

    dll.h
    PHP Code:
    #ifndef _DLL_H_
    #define _DLL_H_

    #define export extern "C" __declspec (dllexport)

    #if BUILDING_DLL
    # define DLLIMPORT __declspec (dllexport)
    #else 
    # define DLLIMPORT __declspec (dllimport)
    #endif 


    class DLLIMPORT DllClass
    {
      public:
        
    DllClass();
        
    virtual ~DllClass(void);

      private:

    };


    #endif 

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    If you have not already done so, read this very carefully, especially the remarks paragraph.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DLL Load issue
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 09-01-2007, 03:42 PM
  2. dll issue
    By axr0284 in forum C++ Programming
    Replies: 1
    Last Post: 03-23-2006, 08:37 AM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. dll : design issue!
    By dug in forum C++ Programming
    Replies: 8
    Last Post: 02-17-2005, 11:48 AM
  5. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM