UE3 - UDK Can't use .dll's: Unknown function modifier 'dllimport'.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Nathaniel3W

Member
Nov 11, 2012
48
0
6
I'm trying to get information from the Razer Hydra (and I posted a very similar question on their forum) but I'm having trouble with binding the dll. I'm using nFringe in Visual Studio 2010 Shell and working with the UDK-2012-07 version of the UDK.

The specific error I'm seeing is this:

Unknown function modifier 'dllimport'.

That happens with every instance of the word, up to the error limit. I get that error whether it's in my program's class that extends GamePlayerController or whether I put it in its own class that extends Object.

As far as I can tell, every class that I make that starts off like

class ____ extends ____ DLLBind(sixense);

is binding to the dll just fine. But that's kind of useless if I can't use dllimport to do anything in the dll. Any idea why Visual Studio (or nFringe or the UDK) isn't recognizing dllimport?
 

Nathaniel3W

Member
Nov 11, 2012
48
0
6
That's the right tutorial. And what you recommended definitely did something! I had just been hitting "debug" before and it would stop at the dllimport problems. But I moved things around a little and now if I build the solution first, then I can at least run the program, even though the errors remain in the error log. Thanks for pointing me in the right direction.

And if you don't mind me asking more questions now, I seem to be having trouble referencing the functions in the dll.

I'm starting with this in MyUnrealGame01.uc:
Code:
class MyUnrealGame01 extends FrameworkGame;

defaultproperties
{
   PlayerControllerClass=class'MyUnrealGame01.MyUnrealGame01PlayerController'
   DefaultPawnClass=class'MyUnrealGame01.MyUnrealGame01Pawn'
   HUDType=class'MyUnrealGame01.MyUnrealGame01HUD'
   PlayerInputClass=class'MyUnrealGame01.MyUnrealGame01PlayerInput'
   bDelayedStart=false
}

And then I have this in MyUnrealGame01PlayerController.uc:
Code:
class MyUnrealGame01PlayerController extends GamePlayerController
	DLLBind(sixense);

Followed by all the stuff you saw in that tutorial.

Then I have DefaultInput.ini and MyUnrealGame01PlayerInput.uc set up with some test functions that are working. For example...

Code:
class MyUnrealGame01PlayerInput extends PlayerInput;

simulated exec function TestFunction1()
{
	ClientMessage("Test");
}

But I can't seem to use those functions. I wonder what I'm doing wrong. In MyUnrealGame01PlayerInput.uc, I'm trying to do this:

Code:
simulated exec function TestFunction2()
{
	MyUnrealGame01PlayerController.sixenseGetAllData();
	ClientMessage("Active Sixense controllers: "$MyUnrealGame01PlayerController.sixenseGetNumActiveControllers());
}

I try building that, and I get this error:
C:\UDK\UDK-2012-07\Development\Src\MyUnrealGame01\Classes\MyUnrealGame01PlayerInput.uc(11,0): error : 'MyUnrealGame01PlayerController': Bad command or expression

Thanks all your help so far. I hope this isn't too much. Any ideas what's going wrong here?
 

Angel_Mapper

Goooooooats
Jun 17, 2001
3,532
3
38
Cape Suzette
www.angelmapper.com
PlayerInput is within PlayerController, so you should have this:

Code:
class MyUnrealGame01PlayerInput extends PlayerInput within MyUnrealGame01PlayerController;

simulated exec function TestFunction2()
{
	sixenseGetAllData();
	ClientMessage("Active Sixense controllers: "$sixenseGetNumActiveControllers());
}

Check your log and make sure your gametype is actually running. You should see this in the log somewhere:

Code:
[0003.70] Log: Game class is 'MyUnrealGame01'

I always use batch files to run the game when I'm testing:

Code:
C:\UDK\UDK-November2012\Binaries\Win32\UDK.exe TESTMAP?Game=MyCode.MyGame -log
 

Nathaniel3W

Member
Nov 11, 2012
48
0
6
We're definitely moving in the right direction! I can get it through the building and debugging. I need to pay more attention to what kind of input functions expect me to pass to them though. :) I commented out the sixenseGetAllData() when I didn't know right away what to send to it, and I could run the game just fine, but TestFunction2() crashed it. I'll try to get sixenseGetAllData() working tomorrow, and then I think everything else should fall into place. Thanks again for all your help!