Jump to content
The simFlight Network Forums

FSUIPC code to read out attitude and position


Recommended Posts

Hi there,

I'd like to read out the position and the attitude with FSUIPC. I already read through the SDK examples.

I am also kind of new in programing big projects.

What I use is a C/C++ code with VS2010. I made several attemps to get the UIPCHello example compiled but VS says that there is is Linker error LNK unresolved ... to external symbol "_imp_wsprintfA" in "_FSUIPC_Open" in file IPCuser.obj.

Is this a major linking error or a VS2010 related error. I set under "Project Properties" additional dependencies to FSUIPC_User.lib and I also use the VS2010 version of FSUIPC_User.lib

Is there a tutorial to set up a visual project for fsuipc?

Thanks in advance

Link to comment
Share on other sites

What I use is a C/C++ code with VS2010. I made several attemps to get the UIPCHello example compiled but VS says that there is is Linker error LNK unresolved ... to external symbol "_imp_wsprintfA" in "_FSUIPC_Open" in file IPCuser.obj.

Odd when wsprintf is a standard Windows API function, defined in the standard WinUser.h header. Seems you omitted to specify a needed library file?

I just tried building it with VS2010, allowing VS2010 to convert my old VS2003 project file into the new VS2010 format and it compiled and linked okay. In the Command Line entry in Properties-Linker it lists all these libs which I didn't actually specify but which it seems to include in any case for a Win32 project: Maybe you've not selected a Windows 32-bit project type?

"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib"

Is there a tutorial to set up a visual project for fsuipc?

Only the Microsoft documentation ro set up a normal Win32 project. I'm really not well up on all the little incompatibilities Microsoft builds in between its assorted releases. All development systems are different in their own ways. I still have to use VS2003 to build FSUIPC3 even though i use VS2010 to build FSUIPC4. And for many of the other FSX-related DLLs I use VS2005! I found sticking to the original versions of VS far easier than trying to figure out their arcane settings.

Regards

Pete

Link to comment
Share on other sites

actually I wanted to set up a usal c/c++ project not as win 32 api. so i find it quite confusing that there is a example as winapi given.

it's very challinging for beginners in programing to figure out all the interactions between c, c++ and winapi specific settings, libs and includes.

I still can not get a small fsuipc program running. Are there any useful tutorials?

Link to comment
Share on other sites

actually I wanted to set up a usal c/c++ project not as win 32 api.

What is a "usual C/C++ project" if it isn't a 32 bit Windows program? Sorry, you've lost me.

so i find it quite confusing that there is a example as winapi given.

it's very challinging for beginners in programing to figure out all the interactions between c, c++ and winapi specific settings, libs and includes.

The Microsoft development systems are challenging to everybody, I assure you. I have been a programmer now for nearly 50 years and I gave up on figuring out most of the confusing options in MS VS.

I still can not get a small fsuipc program running. Are there any useful tutorials?

You have all the source, for UIPCHello and even for the library. in fact it was another user who recompiled the library for VS2010, not I. If you cannot build a small C/C++ program with the sources of what you need, I think you need to refer back to basic C programming? If it's only Microsoft's systems which are defeating you, join the club. Only Microsoft Help may help.

If I were you I'd start by considering why you aren't wanting to build a Win32 program. What other sort of program would you think be able to interface to FS, which is itself a Win32 program?

Regards

Pete

Link to comment
Share on other sites

  • 1 month later...

Hi Pete.

 

After several weeks of work everything works just fine.

Now I wanted to pick up the localizer and glideslipe needle (0x0C48 and 0x0C49) . Anyhow I cannot say if the needle is left or right. The figures a changing with the displacement from the centerline.

 

here is my current code

double FS9Interface::readLocalizer()
{
	DWORD dwResult;
	_int32 loc;
	
	if (FSUIPC_Read(0x0C48, 4, &loc, &dwResult))
	{
		FSUIPC_Process(&dwResult);
		cout << loc << endl;
                cout << loc/(65536.0 * 65536.0 * 65536.0 * 65536.0) << endl;
		return loc;
	}
	return 0;
}

no matter what size and datatype I use, the outcome does not seem to make sense. Am I doing something wrong?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.