- Joined
- Feb 4, 2008
- Messages
- 9,434
- Reaction score
- 689
- Points
- 203
Could you attach a bigger version to a reply? Also is oapiRegisterCustomControls in your sources red underlined?Not sure what you mean. Here is my set up you can see:
Could you attach a bigger version to a reply? Also is oapiRegisterCustomControls in your sources red underlined?Not sure what you mean. Here is my set up you can see:
oapiRegisterCustomControls is in the DLGCTRL.h And mentioned in my cppoapiRegisterCustomControls in your sources red underlined?
DLLCLBK void InitModule(HINSTANCE hModule)
{
g_Param.hDLL = hModule;
//oapiRegisterCustomControls(hModule);
g_Param.tkbk_label = oapiCreateSurface(LOADBMP(IDB_TKBKLABEL));
// allocate GDI resources
g_Param.font[0] = CreateFont(-11, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, "Arial");
}
DLLCLBK void ExitModule(HINSTANCE hModule)
{
//oapiUnregisterCustomControls(hModule);
oapiDestroySurface(g_Param.tkbk_label);
// deallocate GDI resources
DeleteObject(g_Param.font[0]);
}
That means either one of two things:oh. Well I just commented them out and it works
Code:DLLCLBK void InitModule(HINSTANCE hModule) { g_Param.hDLL = hModule; //oapiRegisterCustomControls(hModule); g_Param.tkbk_label = oapiCreateSurface(LOADBMP(IDB_TKBKLABEL)); // allocate GDI resources g_Param.font[0] = CreateFont(-11, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, "Arial"); } DLLCLBK void ExitModule(HINSTANCE hModule) { //oapiUnregisterCustomControls(hModule); oapiDestroySurface(g_Param.tkbk_label); // deallocate GDI resources DeleteObject(g_Param.font[0]); }
case WM_TIMER:
if (wParam == 1) {
t1 = oapiGetSimTime();
if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->CENTERARM1_proc = min(1.0, sts->CENTERARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc);
}
else if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->CENTERARM1_proc = max(0.0, sts->CENTERARM1_proc - (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc);
}
t0 = t1;
}
break;
BOOL CALLBACK RMS_DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
FLEXCRAFT2 *sts = (uMsg == WM_INITDIALOG ? (FLEXCRAFT2*)lParam : (FLEXCRAFT2*)oapiGetDialogContext(hWnd));
// pointer to vessel instance was passed as dialog context
const double step = 0.05*RAD;
static double t0;
double t1;
HICON hIcon;
switch (uMsg) {
case WM_INITDIALOG:
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_UP));
SendDlgItemMessage(hWnd, IDC_WRIST_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_ELBOW_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_SHOULDER_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_DOWN));
SendDlgItemMessage(hWnd, IDC_WRIST_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_ELBOW_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_SHOULDER_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_LEFT));
SendDlgItemMessage(hWnd, IDC_WRIST_YAWLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RIGHT));
SendDlgItemMessage(hWnd, IDC_WRIST_YAWRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RRIGHT));
SendDlgItemMessage(hWnd, IDC_WRIST_ROLLRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RLEFT));
SendDlgItemMessage(hWnd, IDC_WRIST_ROLLLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SetTimer(hWnd, 1, 50, NULL);
t0 = oapiGetSimTime();
return FALSE;
case WM_DESTROY:
KillTimer(hWnd, 1);
return 0;
case WM_TIMER:
if (wParam == 1) {
t1 = oapiGetSimTime();
sprintf(oapiDebugString(), "%2f ", CENTERARM1_proc);
if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->CENTERARM1_proc = min(1.0, sts->CENTERARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc);
}
else if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->CENTERARM1_proc = max(0.0, sts->CENTERARM1_proc - (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc);
}
t0 = t1;
}
break;
}
return oapiDefDialogProc(hWnd, uMsg, wParam, lParam);
}
Could you post the compiler errors? It's hard to troubleshoot errors we can't see.YES.
now to get the animations to work. I think one arm should move but it doesn't
Another thing is the display of the control. If I open the atlantis the same. So must be something not set?Code:case WM_TIMER: if (wParam == 1) { t1 = oapiGetSimTime(); if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) { sts->CENTERARM1_proc = min(1.0, sts->CENTERARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED); sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc); } else if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_GETSTATE, 0, 0) & BST_PUSHED) { sts->CENTERARM1_proc = max(0.0, sts->CENTERARM1_proc - (t1 - t0)*ARM_OPERATING_SPEED); sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc); } t0 = t1; } break;
https://dl.dropboxusercontent.com/u/71242599/flexcraftarm1.jpg
---------- Post added at 04:41 PM ---------- Previous post was at 06:08 AM ----------
ok if I try to see CENTERARM1_proc I get a much of compiling errors.
Code:BOOL CALLBACK RMS_DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { FLEXCRAFT2 *sts = (uMsg == WM_INITDIALOG ? (FLEXCRAFT2*)lParam : (FLEXCRAFT2*)oapiGetDialogContext(hWnd)); // pointer to vessel instance was passed as dialog context const double step = 0.05*RAD; static double t0; double t1; HICON hIcon; switch (uMsg) { case WM_INITDIALOG: hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_UP)); SendDlgItemMessage(hWnd, IDC_WRIST_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_ELBOW_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_SHOULDER_PITCHUP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_DOWN)); SendDlgItemMessage(hWnd, IDC_WRIST_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_ELBOW_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_SHOULDER_PITCHDOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_LEFT)); SendDlgItemMessage(hWnd, IDC_WRIST_YAWLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RIGHT)); SendDlgItemMessage(hWnd, IDC_WRIST_YAWRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RRIGHT)); SendDlgItemMessage(hWnd, IDC_WRIST_ROLLRIGHT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); hIcon = LoadIcon(g_Param.hDLL, MAKEINTRESOURCE(IDI_RLEFT)); SendDlgItemMessage(hWnd, IDC_WRIST_ROLLLEFT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SetTimer(hWnd, 1, 50, NULL); t0 = oapiGetSimTime(); return FALSE; case WM_DESTROY: KillTimer(hWnd, 1); return 0; case WM_TIMER: if (wParam == 1) { t1 = oapiGetSimTime(); sprintf(oapiDebugString(), "%2f ", CENTERARM1_proc); if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) { sts->CENTERARM1_proc = min(1.0, sts->CENTERARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED); sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc); } else if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_GETSTATE, 0, 0) & BST_PUSHED) { sts->CENTERARM1_proc = max(0.0, sts->CENTERARM1_proc - (t1 - t0)*ARM_OPERATING_SPEED); sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc); } t0 = t1; } break; } return oapiDefDialogProc(hWnd, uMsg, wParam, lParam); }
Warning 1 The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'YieldDuringToolExecution' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutoGenerateBindingRedirects, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRule.... C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 18 6 Miscellaneous Files
Error 103 error C2065: 'CENTERARM1_proc' : undeclared identifier E:\orbiter2010p1A\Orbitersdk\samples\FLEXCRAFT2\FLEXCRAFT2.CPP 2101 1 FLEXCRAFT2
104 IntelliSense: command-line error: invalid macro definition: (PreprocessorDefinitions) e:\orbiter2010p1A\Orbitersdk\samples\FLEXCRAFT2\FLEXCRAFT2.CPP 1 1 FLEXCRAFT2
105 IntelliSense: identifier "CENTERARM1_proc" is undefined e:\orbiter2010p1A\Orbitersdk\samples\FLEXCRAFT2\FLEXCRAFT2.CPP 2101 39 FLEXCRAFT2
double CENTERARM1_proc;
sprintf(oapiDebugString(), "%2f ", CENTERARM1_proc);
if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->CENTERARM1_proc = min(1.0, sts->CENTERARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_CENTERARM1, sts->CENTERARM1_proc);[CODE]
here are the 2 errors:
1 IntelliSense: command-line error: invalid macro definition: (PreprocessorDefinitions) e:\orbiter2010p1A\Orbitersdk\samples\FLEXCRAFT2\FLEXCRAFT2.CPP 1 1 FLEXCRAFT2
2 IntelliSense: identifier "CENTERARM1_proc" is undefined e:\orbiter2010p1A\Orbitersdk\samples\FLEXCRAFT2\FLEXCRAFT2.CPP 2101 39 FLEXCRAFT2
I put a break in it and expected to to stop when I ran the debugger. But it didn't. So not sure if it getting there[COLOR="Red"]
[SIZE=1]---------- Post added 09-06-14 at 08:32 AM ---------- Previous post was 09-05-14 at 06:24 PM ----------[/SIZE]
[/COLOR]I am going back to square 1.
but this is something I don't get. For some reason it doesn't see the bitmaps. The top is the error message. The middle is the code. and the bottom is you can see they are there?
Is there something in the solution that links bitmaps?
[IMG]http://i373.photobucket.com/albums/oo179/gattispilot/flexcraftissue_zps476bfcea.jpg[/IMG]