|
Can you show an example of the method declaration and how you were calling it?
What exactly is the problem that's occurring?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Either you pass the member function a pointer to the structure (&structvar), or make the receiving function accept the argument by reference (classname::member(structtype & structvar).
|
|
|
|
|
hi,
Thanks a Lot I get it.
Uday kiran
|
|
|
|
|
/*
Not dialog based but you should get what your
looking for here.
*/
#include "stdafx.h"
#include <stdio.h>
typedef struct
{
int nKey;
int nSize;
} MY_STRUCTURE;
class CBar
{
public:
CBar::CBar() {}
CBar::~CBar() {}
void CBar::DoSomething(MY_STRUCTURE& myStructure)
{
// Modify the structure
myStructure.nKey=45;
myStructure.nSize=99;
}
};
class CFoo
{
public:
CFoo()
{
Start();
}
~CFoo() {}
void Start()
{
CBar bar;
MY_STRUCTURE someStructure={0};
printf("BEFORE: nKey = %d, nSize = %d\n",
someStructure.nKey,someStructure.nSize);
bar.DoSomething(someStructure);
printf("AFTER: nKey = %d, nSize = %d\n",
someStructure.nKey,someStructure.nSize);
}
};
int main(int argc, char* argv[])
{
CFoo foo;
return 0;
}
|
|
|
|
|
hi,
Yes, i cought for this only and you have showed me path.
Thanks a Lot it exaclty what the problem i facing.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: Note: this i am facing in vc++. i am having two dialog classes where i have to send this reference variable from first class member function to second Class member function.
But what is the problem!.. hang, value is not updated or something else!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
hi all;
when i invoke the method below it delets all my objects from the list, can any one please tell me what i am doing wrong?
if there are 3 objects in the list and i am asking to delete the last one, it moves over all of the items but when it deletes the 3rd, it deletes them all..
thanks a lot,
Beri
bool cListAdv::remOneFromList ( long _unqAdvName )
{
if ( ListOfAdv.size() == 0 )
{
return false; // empty list
}
else
{
list<cAdv>::iterator iter ;
iter = ListOfAdv.begin() ; // set the iter to the begining of the list
while ( iter != ListOfAdv.end() ) // if it is not the end continue to check
{
cAdv tempAdv(*iter); // define a temporary adv and set it to the first object
//if (ListOfAdv.size() == 1 ) iter++; // change before deleting the same object - prevent mem error
iter++;
if ( tempAdv.getUnqAdvName() == _unqAdvName )
{
//ListOfAdv.remove( *iter ) ; // if they have the same AdvId remove - removes all objects from list
ListOfAdv.remove( tempAdv );
return true;
}
//++iter;
}
return false ; // not found
}
}
|
|
|
|
|
does cAdv have an == operator ?
lst.remove(x) deletes items from lst which match the value 'x'.
|
|
|
|
|
yes it does,
but it checks a different value;
can list.erase do the job instead?
May The Force Be With You...
|
|
|
|
|
Is there a way to stop items in a list view report style from being sorted alphabetically when they are inserted using the Win32 API?
Thanks for your help!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Don't specify the LVS_SORTASCENDING or LVS_SORTDESCENDING when creating the control?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I havent done that.. I've just created the control with WS_VISIBLE, WS_CHILD and LVS_REPORT.. Then I've set the Extended style to LVS_EX_FULLROWSELECT
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Hmmm I can't reproduce that.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you make it or use of toolbox?
|
|
|
|
|
What do you mean?
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
I wanted to know it you used of ToolBox for insert control to form set sort property to false of property window.
|
|
|
|
|
Thanks for your help everyone But it was my fault and I've fixed the problem
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
If you said how did you solve it maybe helpful for people.
|
|
|
|
|
It wasn't anything to do with the control, it was merely how I inserted the items
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Hi Guys
I am creating a mutex in one application and try to open in other application but it is not opening in other application
may i know what could be the reason
thanks in advance
RYK
|
|
|
|
|
Can you post the code (for both apps) relating to opening the mutex?
On failure, what error code is GetLastError() returning?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi This is the code what i have used for creating mutex and opening mutex
SECURITY_ATTRIBUTES SecAtt;
SecAtt.nLength = sizeof(SECURITY_ATTRIBUTES);
SecAtt.bInheritHandle = true;
SecAtt.lpSecurityDescriptor = NULL;
m_hMutex = CreateMutex(&SecAtt ,FALSE,_T("Global\\DeviceFilterWriteNotification"));
in a Function the same application i have written some pice of code
::WaitForSingleObject(m_hMutex ,INFINITE);
// some percess is executing
if(ReleaseMutex(m_hMutex)) //allows ervice to access status file
WriteLog("Write Mutex Reset Successfully");
else
WriteLog("Failed to Release write Mutex");
in other application which is a service i am opening the Mutex by this way
HANDLE hWrite= OpenMutex(NULL,FALSE,_T("Global\\DeviceFilterWriteNotification"));
ReleaseMutex(hWrite);
Thanks in advance
RYK
|
|
|
|
|
What happens if you specify access flags:
HANDLE hWrite= OpenMutex(MUTEX_ALL_ACCESS, FALSE, _T("Global\\DeviceFilterWriteNotification"));
If that fails, what is the error code?
Also, after OpenMutex(), the thread doesn't own the mutex so there's no need to release it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
VC_RYK wrote: SecAtt.lpSecurityDescriptor = NULL
Try specifiying a security descriptor - use the same one in both your service and your application. If your service is running in the system account, the default security descriptor is NOT the same as the default for the application. This mismatch may be your problem.
Judy
|
|
|
|
|
Hello everybody,
I am in the middle of a project that involves hooking the file/open save and browse for folder dialog boxes of he currently installed windows applications and manipulate them by sending windows message codes.
I am stuck with a problem in doing that.
I have been able to hook into the file/open save dialog boxes and manipulate them , when the applications (Notepad,Wordpad,Adobe Acrobat etc.) uses the windows common control dialogs (i.e Common Dialog Box Library).The window class type of these type of dialogs is #32770(Dialog).
But the microsoft office suite doesnot use this library to generate the file open / save dialogs. The class type for the
MS Office dialogs is "bosa_sdm_Microsoft Office * " , where the " * " stands for Word,Excel,Access etc.
The MSDN states that
The following are messages that a hook procedure can send to an Explorer-style Open or Save As dialog box.
CDM_GETFILEPATH
CDM_GETFOLDERIDLIST
CDM_GETFOLDERPATH
CDM_GETSPEC
CDM_HIDECONTROL
CDM_SETCONTROLTEXT
CDM_SETDEFEXT
But unfortunately sending these messages using
LRESULT SendMessage(
HWND hWnd, // handle to destination window
UINT Msg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
won't do any good in case of Microsoft Office dialogs.
The MSDN also doesnot state what messages I can send to the office dialogs from the hook function to manipulate them or retrieve retrieve information regarding the current folder/file path within the office dialog.
So I am requesting everybody here to provide me the required guidance.
I will be greatful if you people can provide anything useful.
Thanks and regards,
|
|
|
|