|
How do you hide the picture box? Are you using ShowWindow() for that?
|
|
|
|
|
In addition to what Moak mentioned, another thing I would suggest (as an easy workaround) is to remove the static control and enable Client Edge style for picture box.
|
|
|
|
|
When I first heard about Embedded360 and their Fast Embedded Model, I didn’t give much importance to it. But it’s when I worked with them and got to know their work process that I truly understood their approach. Their Agile methodologies combined with technical expertise in the embedded space have helped them in developing flexible, easily accessible, and futuristic solutions that enhance quality and maximize profits. For more details click here: http://www.embedded360.com/[^]
|
|
|
|
|
...
If you're advertising something, pay for it and do it the right way.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i m creating win32 dll in vc++(mfc) application.i have to call dll function from another dll.
But i dont no the way,how to calling dll function from another dll.
Please help me.
Thanks in advance.
|
|
|
|
|
You could use the .lib file and header (the easier way).
Or you could use LoadLibrary()[^] and GetProcAddress()[^]
There are many beginner level tutorials on DLLs at CP. Just search for those and give some of them a read.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
For that purpose, you can either rely on static linking or dynamic linking.
1. Static Linking
a. Add the lib corresponding to the DLL(DLL that is to be called) in Project Settings->Link->Input->Object/library modules.
b. Add the Include file pf the DLL into your project dsp.
c. Call the function after including the header.
2. Dynamic linking- Usually done in case, where you have Def([^]) files, which is mentioned in the above comment by rajesh.
Величие не Бога может быть недооценена.
modified on Friday, February 5, 2010 6:11 AM
|
|
|
|
|
Pay attention to Rajeshs post, LoadLibrary Getprocaddress are great functions to learn to use.
You get a smaller loaded image by using dynamic linking dont forget!
Morality is indistinguishable from social proscription
|
|
|
|
|
Dude, you've picked on a univoter.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I have a tree with some nodes with CheckBox enable
I want to disable few of them because they are compulsory to choose so I want few nodes will be selected and disable so user can not change it.
I searched on net and found method CTreeCtrl::setItemState(...) but it does not have option for disabling a node in xp. Below extended method can do this but it is available in VISTA and later.
http://msdn.microsoft.com/en-us/library/bb385266.aspx
m_treeCtrl.SetItemStateEx( hPA, TVIS_EX_DISABLED );
Please suggest some way..
|
|
|
|
|
Hi all,
I m working on Server - Client type application,using SOCKET to communicate between Server and Client.
I m using RegConnectRegistry to access client registry,but some times this function fails.
please help me for this.
i think its a client server connectivity issue because of security hierarchy.
it happens when server is 2003 and client is VISTA with uac enabled.
or Server is 2008 and client is XP.
please help me.
and please tell me how can use user name and password from server side to access the client.
provide me any help or guidance for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
When server is Windows server 2008 and clinet machine is Windows xp Professional with service pack 3.
in network window when i want to access this client machine its popup a username and password window to access.
in my code if i use RegConnectRegistry without entering username password in network window for xp client,this return a error of Access Denied.
if i use RegConnectRegistry after entering username password in network window for xp client,
than its execute,no error return but after the i want to open the registry by RegOpenKey.
now this return error access denied.
please help me what can i do.
thanks.To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi All
I am try to get data from oracle.I am facing some problem to get data from oracle table when oracle table data type is RAW.For example i have a table in oracle
create table Test(Item RAW(255));
insert into Test values('1');
insert into Test values('2');
Now i am fetching data from Test table.
CString tabledata=Select * from "system"."Test";
pRecordset=m_pConn->Execute(_bstr_t(tabledata), 0, adCmdText);
_variant_t fetchdata;
fetchdata= pRecordset->GetRows(adGetRowsRest);
LONG lend = fetchdata.parray->rgsabound->cElements;
COleVariant varField;
for (int i = 0; i < lend; i++)
{
int k=0;
for (int j = 0; j < nCount; j++)
{
long index[2] = {j,i};
SafeArrayGetElement(fetchdata.parray,index,&varField);
}
}
out put is
varField = {???}
when i click on varFiled then show like this
tagVARIANT = safearray of UI1 = [1](1 '')
But original values is "1".
So how can i get original values.
Please help me
|
|
|
|
|
Hi,
We have SDI application. In which we are opening some dialogs. Once application is up these dialogs can be open and close as many times as possible. If I am opening dialog first time, minimize application(not dialog, i mean whole application) and then maximize application, dialog is also displayed in previous condition. But if i close and open dialog again, on minimize and maximize application make dialog disappear, I have to open dialog explicitly. How can I stop this behavior?
I tried to explain situation as much as possible. If anyone have doubt fire your question.
Thanks.
|
|
|
|
|
I don't know. Two questions do immediately come to my mind, so I will share them in case they lead you somewhere.
Are you consistently setting the parent window everywhere you are creating/recreating the dialogs?
(Presuming you are using MFC) How are you managing the lifetime of CDialog derived object associated with the dialog?
I hope these might lead you somewhere, but I don't know if they will.
|
|
|
|
|
First thing, I am not recreating dialog every time. I mean Once it is created i am not destroying its handle/object till application is down. So setting of parent is done once. I think this will be ans or your second que also. And ya I am using MFC.
|
|
|
|
|
Well, that sounds right. So you will be intercepting user request to close the dialog and hiding it instead.
Something has to have changed in the state of the dialog or object, but I'm afraid I'm not going to come up with it.
My remaining thought is to monitor the windows messages being sent to the dialog in the 2 situations. A difference would obviously be a clue. Failing that, it might suggest a good point to put in a breakpoint.
Good Luck.
|
|
|
|
|
No I am not stoping dialog from being close check this part;
void CHWSimulatorDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
switch(nID)
{
case SC_MAXIMIZE:
ShowWindow(SW_SHOWMAXIMIZED);
bMaximizeFlag = true;
break;
case SC_RESTORE:
case SC_CLOSE:
bMaximizeFlag = false;
CDialog::OnSysCommand(nID, lParam);
break;
default:
CDialog::OnSysCommand(nID, lParam);
break;
}
}
I tried to debug this part, I am not getting any message in this function when I am minimizing whole application.
And I havnt override OnClose function for this dialog.
|
|
|
|
|
I don't think that the code you posted is the problem. It also doesn't seem that useful to me.
Now chevu wrote: No I am not stoping dialog from being close
Combined with other things that you have said, this suggests to me that we may actually be getting somewhere.
First, I'll explicitly state my understanding that we are discussing modeless dialog boxes with associated classes derived from CDialog.
Now let me try to quickly summarize lots of stuff. Some of this may seem to simple to mention. I'm doing it anyway because I suspect that you are missing part of this, but I don't know what part.
In working with modeless dialog boxes in MFC there are 2 things around that one has to worry about. One is a C++ object instantiated from a class derived from CDialog. This is normally dynamically allocated so that its lifetime can be properly managed. The other is the windows object (not a C++ object) that Windows maintains and deals with that a windows handle is connected to. They are associated, but they are somewhat independent things.
A class for a modeless dialog overrides OnOK and OnCancel and does NOT call the default versions. The default ones in CDialog call EndDialog() which is intended for use with modal, not modeless dialogs. (I'm not sure of all the implications of calling it for a modeless dialog, but I suspect this may be a part of your situation.) These overrides might call DestroyWindow() to terminate the dialog and kill the windows object. When it is desired that the dynamically allocated C++ object self-destructs when the dialog is closed, PostNcDestroy() is also overriden.
Typically, one constructs the C++ object and calls Create() which creates and associates the windows object. Later, the user exits the dialog in some way. The programmer has provided code for this that includes a call to DestroyWindow(). Then some programmer provided mechanism deletes the C++ object.
Now you want to do things differently. Once things are created, you want to keep things around (though not necessarily displayed) until the program exits. So when the user "closes" the dialog instead of destroying the window object (via DestroyWindow) and deleting the C++ object, you are writing code to hide the window and keep track that you have done this. Then when you want to display the dialog again you would just show the window.
It now sounds like this isn't what you are actually doing. Perhaps you are letting EndDialog() be called. I don't know just what state that would leave the window object in.
Hopefully this gives you some direction. Now I have to get to bed before I finish falling asleep.
|
|
|
|
|
Hi
I want to save class instance addresses to a vector. How can I get address of a class instance?
class A {}
A* pA = new A;
How can I get "pA" address value and assigned to a variable?
Thanks,
|
|
|
|
|
|
Thanks,
So I can implement like:
std::vector<void*> classAddress;
classAddress.pushback(&pA);
|
|
|
|
|
No, I don't think so - in that code pA is the instance pointer. &pA is the address of the pointer pA that holds the instance address, and is temporary (unless it's a global).
Instead, I would suggest:
class A { ... };
A* pA = new A;
std::vector<void*> classAddress;
classAddress.push_back(pA);
Why std::vector<void*> instead of std::vector<A*> though? Are you going to store pointers to different types there?
|
|
|
|
|
Thank you for your reply.
I need to save all kinds of classes. Not only class A.
|
|
|
|
|
In this approach, you will have problems knowing what each item is or being able to do anything with them.
If these objects are all related by all being the same sort of thing and based on a common base class, you could use a vector of pointers to the common base class.
If these objects are not related, you might think about another organization that will reflect what they are.
As a side note, don't forget about deallocating whatever you have allocated.
|
|
|
|