Click here to Skip to main content
14,218,548 members

C / C++ / MFC

 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus16-Mar-15 15:36
memberTacitonitus16-Mar-15 15:36 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C16-Mar-15 22:39
memberFrankie-C16-Mar-15 22:39 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 3:34
memberTacitonitus17-Mar-15 3:34 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 4:11
memberFrankie-C17-Mar-15 4:11 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 7:21
memberTacitonitus17-Mar-15 7:21 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 7:29
memberFrankie-C17-Mar-15 7:29 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 22:48
memberFrankie-C17-Mar-15 22:48 
QuestionVC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Member 988367216-Mar-15 1:38
memberMember 988367216-Mar-15 1:38 
Here i created in DLL project in vc++ 2008. Following are two code files lib.h and lib.cpp.
lib.h
#include "stdafx.h";

    class __declspec(dllexport) test
    {
    public:
        test();
        static void  hello();
        static void  hello1();
    };

    class __declspec(dllexport) test1
    {
    public:
        test1();
        void  hello_test1();
        void  hello1_test1();

    };

lib.cpp
#include "stdafx.h"
   #include "lib.h"
   #include <stdio.h>

   void test::hello()
   {
       printf("Hello");
   }

   void test::hello1()
   {
       printf("Hello1");
   }

   void test1::hello_test1()
   {
       printf("Hello_test1");
   }

   void test1::hello1_test1()
   {
       printf("Hello1_test1");
   }

stdafx.h
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN 
// Windows Header Files:
#include <windows.h>

dllMain.cpp
#include "stdafx.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

I have written C# code to call the method of test and test1 classes:
consoleApp
 [DllImport("lib.dll" )]
    public static extern void hello();

    [DllImport("lib.dll")]
    public static extern void hello1();

    [DllImport("lib.dll")]
    public static extern void hello_test1();

    [DllImport("lib.dll")]
    public static extern void hello1_test1();

 static void Main()
{ 
        hello();
        hello1();
        hello_test1();
        hello1_test1();
        Console.ReadKey();
    }

when i run above code i have got following error: EntryPointNotFoundException: Unable to find an entry point named 'hello' in DLL 'lib.dll' 1****<-Click 1 for image
I know about how to call function only(without using Class) of vc++ DLL from C# but i don't know how to call method of any class and how to code that in proper way in vc++.

I know somewhere is mistake in my above code, please experts guide me about my mistake because i tried all from my side.

If anyone has full example like above then suggest me.

Thanks in advance..
AnswerRe: VC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Richard Andrew x6416-Mar-15 5:48
professionalRichard Andrew x6416-Mar-15 5:48 
QuestionIAccessible - get word under mouse pointer in IE Pin
Fourblack15-Mar-15 22:01
memberFourblack15-Mar-15 22:01 
QuestionC++ to C problem Pin
alexx00614-Mar-15 10:03
memberalexx00614-Mar-15 10:03 
AnswerRe: C++ to C problem Pin
Richard Andrew x6414-Mar-15 13:15
professionalRichard Andrew x6414-Mar-15 13:15 
AnswerRe: C++ to C problem Pin
Frankie-C15-Mar-15 5:49
memberFrankie-C15-Mar-15 5:49 
GeneralRe: C++ to C problem Pin
David Crow16-Mar-15 2:54
memberDavid Crow16-Mar-15 2:54 
QuestionUI widget Pin
Member 1152499814-Mar-15 7:01
memberMember 1152499814-Mar-15 7:01 
AnswerRe: UI widget Pin
Albert Holguin15-Mar-15 17:19
professionalAlbert Holguin15-Mar-15 17:19 
QuestionUI widget Pin
Member 1152499814-Mar-15 6:52
memberMember 1152499814-Mar-15 6:52 
QuestionFeatures and rich documentation of MFC vs Small Executable of WTL Pin
Member 1120327711-Mar-15 4:21
memberMember 1120327711-Mar-15 4:21 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
jeron111-Mar-15 5:53
memberjeron111-Mar-15 5:53 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
Eddy Vluggen11-Mar-15 6:28
mveEddy Vluggen11-Mar-15 6:28 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
Albert Holguin15-Mar-15 17:29
professionalAlbert Holguin15-Mar-15 17:29 
QuestionSftTree.dll, v4.0.0.0 performance issue With C# Winform Pin
vipin kumar sharma10-Mar-15 1:43
membervipin kumar sharma10-Mar-15 1:43 
SuggestionWrong Forum Pin
Richard Deeming10-Mar-15 2:04
mveRichard Deeming10-Mar-15 2:04 
QuestionEjecting USB memory sticks problem Pin
Still learning how to code10-Mar-15 1:07
memberStill learning how to code10-Mar-15 1:07 
AnswerRe: Ejecting USB memory sticks problem Pin
David Crow10-Mar-15 2:42
memberDavid Crow10-Mar-15 2:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.