Solved

GetGestureInfo entry point not in USER32.dll

Posted on 2014-03-19
2
830 Views
Last Modified: 2014-04-08
I make reference to GetGestureInfo in my app so that I can do some touchscreen things when the PC is so-enabled.  I only need it to work on win7 and win8.  But I can't even run my app on XP now because of the "entry point not found" error as in the title of this question.   So, what is a good way to avoid this?  I don't want a solution that requires a separate build for XP if at all possible.   Can I do something like put my call to GetGestureInfo in a DLL and then dynamically link that DLL only if I see I'm running on win7/8 ?  Something like that?  What is best/easiest way?  Thanks!

My app is MS C++ using a bit of MFC and using VS2010.
0
Comment
Question by:tullhead
2 Comments
 

Author Comment

by:tullhead
ID: 39946851
Further to this.  So now I'm trying to put the call to GetGestureInfo in a dynamically linked DLL.  Then I just won't load it if I see that I'm on XP.  But I'm not too good at DLL and passing arguments to functions in them, and whats allowed and what isn't.

I try to allocate dynamically the GESTUREINFO in my main program, so that I have a pointer to it to pass to the function in the DLL -- is this going to work safely?  SO, in main program something like:
   
        GESTUREINFO* pgi = new GESTUREINFO();
         ZeroMemory(pgi, sizeof(GESTUREINFO));
         pgi->cbSize = sizeof(GESTUREINFO);

Then I try to call the function which is in the DLL:

        BOOL bResult = theApp.CallGetGestureInfo(lParam, pgi);

But its crashing.  Even if, in the DLL I don't even call GetGestureInfo -- as a test, I simply
have the function in the DLL return the BOOL "false".  Still, main program crashes.

What am I doing wrong?
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 39951778
You must expect this kind of problem when you develop for one revision and then seek to run on an older revision. The way you have approached it looks fine to me.
You need to debug this: after executing line 1, does pgi contain a valid memory pointer? What is sizeof GESTUREINFO? Does your GESTUREINFO::GESTUREINFO() allocate that much memory? Is pgi still good at the start of line 3? and so on.
After that, you need to debug your DLL
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
simple redial program 3 86
How to split this in C++ 4 77
parentbit challenge 3 52
Any free software for printscreens 7 64
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
The viewer will learn how to set up a document for the web and print and the recommended PPI for printing.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now