|
There is no such method (at least there isn't in MSVC6, which you seem to be using). Here's the definition (which you could have easily found yourself):
class CRegKey
{
public:
CRegKey();
~CRegKey();
public:
operator HKEY() const;
HKEY m_hKey;
public:
LONG SetValue(DWORD dwValue, LPCTSTR lpszValueName);
LONG QueryValue(DWORD& dwValue, LPCTSTR lpszValueName);
LONG QueryValue(LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount);
LONG SetValue(LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL);
LONG SetKeyValue(LPCTSTR lpszKeyName, LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL);
static LONG WINAPI SetValue(HKEY hKeyParent, LPCTSTR lpszKeyName,
LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL);
LONG Create(HKEY hKeyParent, LPCTSTR lpszKeyName,
LPTSTR lpszClass = REG_NONE, DWORD dwOptions = REG_OPTION_NON_VOLATILE,
REGSAM samDesired = KEY_ALL_ACCESS,
LPSECURITY_ATTRIBUTES lpSecAttr = NULL,
LPDWORD lpdwDisposition = NULL);
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName,
REGSAM samDesired = KEY_ALL_ACCESS);
LONG Close();
HKEY Detach();
void Attach(HKEY hKey);
LONG DeleteSubKey(LPCTSTR lpszSubKey);
LONG RecurseDeleteKey(LPCTSTR lpszKey);
LONG DeleteValue(LPCTSTR lpszValue);
};
Steve
|
|
|
|
|
How to post a message from MainFrm to the dialog , psl adv
|
|
|
|
|
Please, don't repeat your questions. Everybody saw your question the first time, no need to post it twice: this is considered rude behavior.
|
|
|
|
|
I am sorry, I thought the secound part in my prevoius post is not answerted
I am sorry again
|
|
|
|
|
Hi all,
i have a application(Exe) which will load 2 dlls A.dll and B.dll, A.dll will create a map table(STL Map object) i have to use this map object in B.dll how should i do this ?
Using pragma Data section or using Memory map files ?
Thanks in advance
|
|
|
|
|
|
This is quite a complicated thing and there are may ways to do it and many pitfalls. If your not sure how to do this (and perhaps even if you are) perhaps it's best to use an existing library such as Boost.Interprocess[^].
Steve
|
|
|
|
|
Vijjuuuuuuuuu........... wrote: Using pragma Data section or using Memory map files ?
If both A.dll and B.dll are in same process, you dont need to share it using #pragma . Just declare the variable as global and export it in the A.dll.
Also you please note the below two points
1. Sharing the data segments using #pragma is used to share a data in a dll across multiple process. Not between two dlls in same process or multiple process.
2. You will not be able to share a map using shared section, because the map will be holding pointers to many dynamically allocated memories, which is valid only in corresponding process. Trying to access it from another process result in access vialotion.
|
|
|
|
|
Thank you very much for you reply naveen and thanks for your note
|
|
|
|
|
I want to pass parameter to dialog,
so that I need them during InitDialog()
and also I wnat to post a messsage from MainFrm to the dialog, when the dialog is active.
Pls advice
|
|
|
|
|
Pass it before calling DoModal (you can for example pass it in the constructor, or in a separate setter function).
|
|
|
|
|
How to post a message from MainFrm to the dialog , psl adv
|
|
|
|
|
And why do you need to send a message to modal dialog?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
I want to close the Dialog, after getting trigger from main window,
Some theread are running in the Dialog, Once after getting message from MainFrm, I want to End the threads and then close the dialog
Thanks
|
|
|
|
|
Do you know a modal dialog call is a blocking one?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yes ..But that is my requiremt, is there any work around for this
|
|
|
|
|
Why don't you make the dialog modeless?
See, for instance, here [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What do you mean ? You would like to be able to still interact with your main window when your modal dialog is shown ? That's not possible, unless you use a non-modal dialog.
|
|
|
|
|
If the dialog is modal, it closes itself (i.e., the main window's message pump is blocked until the dialog is closed). Otherwise, you'll need to make the dialog modeless.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
error C2065: 'iPrgBarMaxVal' : undeclared identifier,
But it is already declared
.h
public:
int iPrgBarMaxVal;
int iPrgBarStepVal;
CPrgpopup(CWnd* pParent = NULL);
CPrgpopup(CWnd* pParent = NULL, int iPrgMaxVal=60,int iPrgStepVal=2);
.cpp
CPrgpopup(CWnd* pParent = NULL,int iPrgMaxVal=60,int iPrgStpVal=2)
{
iPrgBarMaxVal = iPrgMaxVal;
iPrgBarStepVal = iPrgStpVal;
}
|
|
|
|
|
Did you try to re-build the solution?
Can you post the whole error message (i.e. include the reference to the line the error occurred)?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
MainFrm.cpp
MainFrm::OnStart()
{
....
popupDlg= new CPrgpopup(NULL, iProgressBarMaxVal,iProgressBarStepVal);
hwnd=AfxGetApp()->GetMainWnd()->GetSafeHwnd();
THREADSTRUCT5 *_param = new THREADSTRUCT5;
_param->_this = this;
thMPrgBar=AfxBeginThread (StartProgressBarThread, _param);
.....
}
UINT MainFrame::StartProgressBarThread (LPVOID param)
{
THREADSTRUCT5* ts = (THREADSTRUCT5*)param;
ts->_this->popupDlg->Create(IDD_PROGRESS_BAR_DIALOG,NULL);
ts->_this->popupDlg->ShowWindow(TRUE);
}
Prgpopup.cpp
CPrgpopup::CPrgpopup(CWnd* pParent, int iPrgMaxVal,int iPrgStpVal)
{
iPrgBarMaxVal = iPrgMaxVal;
iPrgBarStepVal = iPrgStpVal;
}
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: .....\DebugMDd\navigat.exe
File: strcore.cpp
Line: 512
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
---------------------------
navigator.exe - Application Error
---------------------------
The exception Breakpoint
A breakpoint has been reached.
(0x80000003) occurred in the application at location 0x77f9193c.
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------
---------------------------
navigator.exe - Application Error
---------------------------
The exception Breakpoint
A breakpoint has been reached.
(0x80000003) occurred in the application at location 0x77f9193c.
Click on OK to terminate the program
---------------------------
OK
---------------------------
|
|
|
|
|
The above has nothing to do with your former post's error.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|