|
I had Buil my source code and be error like follow,
Please help Me....to solve them (my mail:thoyib.bustomi@iaodt.com) :
1>Compiling resources...
1>Linking...
1>LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
1>.\maxcust.def(3) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
1>.\maxcust.def(4) : warning LNK4017: EXETYPE statement not supported for the target platform; ignored
1> Creating library .\Debug/maxcust.lib and object .\Debug/maxcust.exp
1>mc200.obj : error LNK2019: unresolved external symbol __imp__wsprintfA referenced in function _GetText
1>mc200.obj : error LNK2019: unresolved external symbol __imp__GetWindowTextA@12 referenced in function _A_FindItemNum
1>mc300.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextA@12
1>mc400.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextA@12
1>mc200.obj : error LNK2019: unresolved external symbol __imp__SetWindowTextA@8 referenced in function _A_CompatibleRef
1>mc300.obj : error LNK2001: unresolved external symbol __imp__SetWindowTextA@8
1>mc400.obj : error LNK2001: unresolved external symbol __imp__SetWindowTextA@8
1>mc200.obj : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function _A_CheckApproverRequester
1>.\Debug/maxcust.dll : fatal error LNK1120: 4 unresolved externals
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 8.00.50727
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Developer's Kit\maxcust\Debug\BuildLog.htm"
1>maxcust - 9 error(s), 1054 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
|
|
|
|
|
add an #include to afxwin.h in your project.
But this seems weird, usually this goes automatically added to the project when creating it. What plateform are you compiling for ? CE ?
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
Rage wrote: add an #include to afxwin.h in your project.
If afxwin.h was missing, he would be receiving compiler errors, not linker errors.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Whats your application type and your compiler?
|
|
|
|
|
specify the user32.lib in the link tab->object/library modules of the project settings
nave
|
|
|
|
|
Hello,
I'm using this code in all the dialogs of my app:
void CTAM_BODlg::OnActivateApp(BOOL bActive, DWORD dwThreadID)
{
CDialog::OnActivateApp(bActive, dwThreadID);
#ifndef DEBUG
if (bActive == FALSE)
{
this->SendMessage(WM_CLOSE);
}
#endif
}
The thing is that it seems it don't work always, sometimes the application just don't get closed.
I cannot get the keyboard strokes and neither I can get the mouse events, the computer in which that application is installed is not a normal computer, it is a robot controller. The software on the robot allows me to launch my application, but it don't allow me to get the keystrokes as the keyboard is not a normal keyboard that they are handling in a special way. In any way, when the customer presses one defined key, automatically the robot controller computer sets the focus to the main robot application. After that point I'd like to get my application closed. And this is what it fails sometimes.
What could I check or modify in order to make it work always?
As always thank you in advance.
|
|
|
|
|
Can you debug it (not with the debugger, but with a message on a display or something, just to be sure you are indeed going through the code ?)
You could as well try the OnKillFocus handler instead.
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
I'm using this code in all the dialogs of my app:
In regard to this info, your call SendMessage(WM_CLOSE) is wrong. It would close the application only when 'this' is the main window pointer. Otherwise, the call closes a concrete dialog only. [Actually, you'd rather call PostMessage not SendMessage, anyway..].
Put AfxPostQuitMessage(0) instead of sending WM_CLOSE.
--
=====
Arman
|
|
|
|
|
I'm using a GlobalAddAtom function in my project to add a string and later posting a string(ATOM) to a window. I want to know the significance of this function. Well the intent here is to send a concatenated string to a window by means of PostMessage. But I really could not understand the significance of the same.
|
|
|
|
|
It allows a kind of interprocess communications: defining a global string that can be later retrieved by a numeric ID you can effectively send a string from an application to another one (e.g.PostMessaging the numeric ID to the receiving application).
Of course, documentation [^] helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have created this tabbed dialog application and I want to have a wizard-like dialog inside to one of my tab controls..
Please help me how to do it..
I have a code already but it hangs up...
Anyone interested...please email me at ntongoy@infoweapons.com
Thank you!!!!
-- modified at 5:56 Wednesday 23rd May, 2007
|
|
|
|
|
I think that the best you can do is to make a property sheet and embed it into the dialog you are working by setting it as a child. Then each tab will have it's own dialog resource and it will be very easy to maintain.
Hope this helps...
|
|
|
|
|
Thats somehow what I did. But its somewhat complicated...
E.g.
I have have tab1. Tab1 is designed to act like a wizard. It contains a button "next". Everytime I click next, the dialog changes. But it is still in Tab1.
If you want to have a look at the code, I can send it to you through email.
Thanks...
|
|
|
|
|
If you have a propoerty sheet and a tab control, then it is normal that they are behaving in this way, as they are different controls that are not intended to work together if you don't program it by yourself.
What I'd do is:
make the property sheet not in wizard style and then insert a next, previous... button in each page, then it will be easy to use the same code that you are using now in order to go to the next tab and at the same time you'll get the right tab above (without coding).
|
|
|
|
|
for example:
<br />
<br />
<br />
class A<br />
{<br />
public: <br />
B m_b;<br />
}<br />
<br />
class B<br />
{<br />
public:<br />
A m_a;<br />
}<br />
<br />
if I define like this:
<br />
class B;<br />
class A<br />
{<br />
public: <br />
B* p_b;<br />
void fun();<br />
}<br />
<br />
class B<br />
{<br />
public:<br />
A m_a;<br />
void funB();<br />
}<br />
compile would be succeed, but if I define A::fun like this:
<br />
void A::fun()<br />
{<br />
p_b->funB();
}<br />
how to solve?
thanks.
|
|
|
|
|
Separating the class declarations and definitions to different files would help you to compile the project. Also you may need to make A m_a; in the class be as A* m_a;
a.h
--------
#ifndef CLASS_A
#define CLASS_A
class B;
class A
{
public:
B* p_b;
void fun();
};
#endif
a.cpp
-----
#include "stdafx.h"
#include "a.h"
#include "b.h"
void A::fun()
{
p_b->funB(); // error: can not find class B::funB
}
b.h
-----------------
#ifndef CLASS_B
#define CLASS_B
class A;
class B
{
public:
A* m_a;
void funB();
};
#endif
b.cpp
-------
#include "b.h"
void B::funB()
{
printf("funb");
}
HTH
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I have a calculation DLL that display a dialog with a progressbar.
So when an application calls this DLL function, the progress dialog is displayed untill the calculation is complete.
But the problem is, when I remove the focus from the calling application (click on another application in the windows taskbar) and re-set the focus on the calling application (re-selecting the the calling application in the windows taskbar) while the DLL is calculating and displaying the progress dialog. The calling application will display but the progress dialog remians minimized in the taskbar. I need the progressdialog to display on top of the calling application when I re-set the focus on the calling application.
I've tried using SetForegroundWindow() on the progress dialog, but the problem I had with this is, that you don't have control over any of the windows in the background untill the calculation DLL is complete. I must have control of the background windows while the DLL is calculating. I've also set the Topmost property but it had no effect.
Any ideas?
|
|
|
|
|
pass the handle of the main dialog to the dll and in dll while creating the progess dialog, set the main dialog as parent window.
nave
|
|
|
|
|
The main dialog is an exe (NI TestStand), not something that I wrote, so I don't know if it is possible to obtain a handle of the main dialog and pass it into the DLL? Maybe I can try and get the handle of the caller app from within the DLL?
I've tried to used AfxGetApp() but it ends up giving the handle to the DLL.
|
|
|
|
|
If you call AfxGetMainWnd() from the same thread in which the exe created the main dialog, you can get the handle of it.
If that too dosent worked, there is FindWindow() na?
nave
|
|
|
|
|
fusion2344X wrote: I have a calculation DLL that display a dialog...
Modal or modeless dialog?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is it possible to get total folder size, I use SHBrowseForFolder(LPBROWSEINFO lpbi) function? Or do I need to browse each file inside folder and use CFile::GetLength() and add up to retrive folders's total size?
Thx
|
|
|
|
|
|
Hello,
I have changed icon for my child window by defining a window class in a non Doc-View architecture
lpszClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
LoadCursor(NULL, IDC_ARROW),
HBRUSH) (COLOR_WINDOW+1),
LoadIcon(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDI_ICON1)));
But I am not able to change the menu for my child window.
I tried by doing the following in ChildFrame's
PreCreateWindow(CREATESTRUCT& cs)
{
cs.lpszName = "my Window";
cs.hInstance = AfxGetInstanceHandle();
CMenu M;
M.CreateMenu();
M.AppendMenu(MF_CHECKED ,MF_OWNERDRAW,"sasas");
M.AppendMenu(MF_CHECKED ,MF_OWNERDRAW,"sassaaaa");
cs.hMenu = M;
}
Where I went wrong ?
Or if the above code is not clear .then can you tell me how should I change menu for my child windows
Prithaa
|
|
|
|
|
Hi,
from VC++ Help:
The CREATESTRUCT structure has the following form:
typedef struct tagCREATESTRUCT {
LPVOID lpCreateParams;
HANDLE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCSTR lpszName;
LPCSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT;
The CREATESTRUCT structure defines the initialization parameters passed to the window procedure of an application.
Members
lpCreateParams: Points to data to be used to create the window.
hInstance: Identifies the module-instance handle of the module that owns the new window.
hMenu: Identifies the menu to be used by the new window. If a child window, contains the integer ID.
Maybe is there?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|