Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1051175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:53:24+00:00 2026-05-16T16:53:24+00:00

I have created a simple GUI using Windows Forms in visual C++ 2008. There

  • 0

I have created a simple GUI using Windows Forms in visual C++ 2008. There is a button in the GUI. When the button is pressed I want mouse cursor to point at coordinates (0,900). I have created separate header and c++ source file that sets the cursor position to specified location (x,y). For this I have used Win32’s SetCursorPos() function. I wrote the code for setting the cursor position in a separate file because I want only the GUI to be built using .NET. For other functions I want to use native C++ and Win32 library.

While building the code, I get following error messages at the time of linking:

1>SimpleForms.obj : error LNK2028: unresolved token (0A00000F) "extern "C" int __stdcall SetCursorPos(int,int)" (?SetCursorPos@@$$J18YGHHH@Z) referenced in function "private: void __clrcall SimpleForms::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@SimpleForms@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)

1>SimpleForms.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall SetCursorPos(int,int)" (?SetCursorPos@@$$J18YGHHH@Z) referenced in function "private: void __clrcall SimpleForms::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@SimpleForms@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:53:24+00:00Added an answer on May 16, 2026 at 4:53 pm

    (?SetCursorPos@@$$J18YGHHH@Z)

    Note how the function name got the C++ name decoration. Your declaration of the function is wrong, using extern “C” is required. Avoid these kind of mistakes by simply including <windows.h>.

    But, don’t do it this way. Windows Forms lets you move the cursor too:

        System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
            System::Windows::Forms::Cursor::Position = Point(0, 900);
        }
    

    I was seriously misled by the name decoration, that’s an unpleasant linker error message. The real problem is that your project isn’t linking the required Windows import library. Right-click the project, Properties, Linker, Input. Remove the $(NoInherit) from the Additional Dependencies setting. If you use VS2010 then put “user32.lib” in that setting.

    You should still use the .NET Cursor class in this specific case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Bindings in WPF as you are trying to achieve can… May 16, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer I rethinked my whole design starting to change the domain… May 16, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer I would try @thing.user = User.find(current_user.id) instead in your controller.… May 16, 2026 at 11:36 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have created a simple gui with curses. However, when the curses menu is
I have a simple Java Swing GUI Form with a browse button. The browse
I have an application that is a not so simple Windows service (C#). I
I want to create a simple C# GUI with a textbox in it for
I've been told that creating GUI's using drag and drop generates unnecesary code and
Using: C#, VS2008 I have the following main form class: [Main.cs] namespace Server {
I have a simple m-file function [fRate,Height,Width] = media(filename) obj = mmreader(filename); fRate =
I have a Windows service written in Delphi. One of the third-party resources it
I have a workspace with the following 3 projects: Library Tests GUI The tests
I am currently converting what was a Console Application into a Windows Form application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.