|
|
Either the controls are null or (i.e not initialised) or you are doing something noddy wrong like calling from the wrong window. If they are null, try adding a member variable for each resource id, and a DDX routine for each one. Make sure you are not calling GetDlgItem() before OnInitialUpdate();
"Life begins at 140"
|
|
|
|
|
You are right. I called a _itoa() function right before the GetDlgItem functions. I forgot to give the char variable an extra byte for the null char. That caused all sorts of problems. Thanks you.
-Elizabeth
Eilzabeth
|
|
|
|
|
I am importing OIP22.TLB in one of my header file. I am trying to connect to a oracle database which is on unix box through by VC++ application.
The following is the code I am using:
BSTR bstrDb = m_strOraDb.AllocSysString ();
BSTR bstrUser = m_strOraUser.AllocSysString ();
m_pOraDatabase = m_pOraSession->GetOpenDatabase( bstrDb, bstrUser, ORADB_DEFAULT);
m_strOradDb , m_strOraUser are Const CString
Values in m_strOraDb and m_strOraDb are : "omst", "oms/oms" (Our database name, userid/password, ORADB_DEFAULT = 0)
From above it goes into this routine of OIP22.TLI file:
#pragma implementation_key(36)
inline IDispatch * OraSession::GetOpenDatabase ( BSTR dbname, BSTR connect, long options ) {
IDispatch * _result;
_com_dispatch_method(this, 0x60010002, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&_result,
L"\x0008\x0008\x0003", dbname, connect, options);
return _result;
}
It fails just before return_result saying:
First-chance exception in MYAPP.EXE (KERNEL32.DLL): 0xE06D7363
|
|
|
|
|
ravi28 wrote:
First-chance exception in MYAPP.EXE (KERNEL32.DLL): 0xE06D7363
That is a Microsoft C++ exception. Set your debugger to always break on this exception and you should find out where it's coming from.
|
|
|
|
|
Hi,
Bear with me, I am a actually a VB guy, I went to exceptions and selected stop always for this error code. I know that it is breaking when I call a method of OIP22.TLH file, I am confident that am sending the right parameters but it still fails with this exception. Is this get to do with versions of Oracle installed on my machine or nothing??? What is the path you would suggest me to go with????
ravi
|
|
|
|
|
Hi,
Bear with me, I am a actually a VB guy, I went to exceptions and selected stop always for this error code. I know that it is breaking when I call a method of OIP22.TLH file, I am confident that am sending the right parameters but it still fails with this exception. Is this get to do with versions of Oracle installed on my machine or nothing??? What is the path you would suggest me to go with????
ravi
|
|
|
|
|
Hello,
How can I get the size of physical and virtual memory used by a process?
Thanks, Alma
|
|
|
|
|
alma wrote:
How can I get the size of physical and virtual memory used by a process?
Physical, not from Win32. Virtual, GetProcessWorkingSetSize.
|
|
|
|
|
I found the following solution:
<br />
DWORD dwProcessID = GetCurrentProcessId();<br />
HANDLE hProcessHandle = OpenProcess( PROCESS_QUERY_INFORMATION, FALSE, dwProcessID);<br />
<br />
PROCESS_MEMORY_COUNTERS p;<br />
GetProcessMemoryInfo(hProcessHandle , &p, sizeof(PROCESS_MEMORY_COUNTERS);<br />
logit("Using [PM - %d] [VM - %d]", p.WorkingSetSize, p.PagefileUsage);<br />
It needs 'psapi.h' (and 'psapi.lib' if you want to load 'psapi.dll' statically).
-Alma-
|
|
|
|
|
In my program I need to remove the everyone security group and another one in it's place.
|
|
|
|
|
I have an MDI application with multiple view classes. Now I want to use one of these view classes in an SDI application. The problem is that in the OnInitialUpdate() function I call Create(...) for some ownerdraw buttons. When I use the class in SDI it will call OnItialUpdate() several times for the same view, for example every time File Open or File New is selected. This crashes the program as it tries to create buttons that allready exist.
What is the simplest method to avoide multiple calls to OnInitialUpdate()? Or, where else should I call Create() ?
To me it seems ridiculous to call OnInitialUpdate several times, the name is an indication that it is a one-off event
Regards, Haakon S.
|
|
|
|
|
How about calling your Create() in in the view's OnCreate() ?
|
|
|
|
|
I tried OnCreate(), and it didn't work. But mind you, it may have failed not because of the buttons Create() functions, but because of the next piece of code, LoadBitmap(). I got an ASSERT because hWnd==NULL. It is a general problem that I want to do a lot of initialisation after the view is created, but before it is visible. And I want to do it once.
Haakon S.
Joggers live two years longer. But those two years they spend jogging.
|
|
|
|
|
As long as your window isn't created hWnd is NULL. Thus you should first call the base class' OnCreate(). When finished, your windows hWnd should contain a valid handle - if not, I'm not certain what to do .
|
|
|
|
|
I've checked it again, and yes, maybe you are pointing in the right direction . But I'm not home free
I've got some CStatic members in the resource template (my view is CFormView), identified as IDC_TOP and IDC_BOTTOM. They are subclassed into CStatic derivatives for color and blinking:
m_stTop.SubclassDlgItem(IDC_TOP, this);
m_stBottom.SubclassDlgItem(IDC_BOTTOM, this);
This works fine in OnInitialUpdate(), but not in OnCreate() . Next time OnInitialUpdate() comes back, I've got an error.
Joggers live two years longer. But those two years they spend jogging.
|
|
|
|
|
Here's a hack:
add a member variable to your view class
BOOL m_bOnInitialUpdateRan;
Set it to false in your view's constructor
m_bOnInitialUpdateRan = FALSE;
and then in OnInitialUpdate only create your controls if it is FALSE. Be sure to set it to TRUE afterwards.
if (!m_bOnInitialUpdateRan)
{
m_bOnInitialUpdateRan = TRUE;
}
Note: This is not tested, so give it a try. May work, may not
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
In my MFC MDI app I spawn CDIAlog derived windows from the View class. In the release version, if I close the CDialog, and then exit the whole app, it crashes. Doesnt crash if you exit while the CDialog is still up. ALso doesnt crash if we comment out the PostMessage()and then close the CDialog and exit !!!!Heres the OnClose for the CDialog:
void CImageDisplay::OnClose(void)
{
m_pParentWnd->PostMessage(UDM_UPDATEDISPLAY,m_imageDisplayVectorIndex);
CDialog::OnClose();
}
For the handler that runs when the msg is received by the vIew
LRESULT CSVBoxView::OnUDMUpdateDisplay(UINT index)
{
return 0;
}
SendMessage causes really strange behavior in the whole program, and its not really what I want to do. SO what is so peculiar about the postmessage? It does get sent because you step into the handler when debugging...
Please help!
Appreciate your help,
ns
|
|
|
|
|
The signature for the message handler is wrong, it should be
LRESULT CSVBoxView::OnUDMUpdateDisplay ( WPARAM wParam, LPARAM lParam ) the sig used for any generic message handler. It's crashing because PostMessage() puts two parameters on the stack, but the function only removes one, so when the function returns it doesn't read its return address off the stack correctly.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I am so glad to get your response> That indeed was it> I cant thank you enough!!!!
Appreciate your help,
ns
|
|
|
|
|
Michael Dunn, beat me to it. A similar problem was one of my first ' pain in the neck ' bugs, when I was still a newbie. The sigs for message handlers have to be correct in release mode, but usually sail through in debug mode without complaint
"Life begins at 140"
|
|
|
|
|
Hi There,
Let's say I've got an MFC MDI app with three child frames open. How do I figure out which one is the active one?
Thanks,
Aaron
|
|
|
|
|
CFrameWnd supports a function called GetActiveView(). This should work for your purposes.
|
|
|
|
|
Hi All,
I'm creating a toolbar and I have a couple of questions:
1) when setting up a button on a tool bar to be multiple state (i.e. start/stop) and I want to change the bitmap displayed on the button, how do I change the bitmap on the button? And does this bitmaps need to be inserted as an icon or do they both need to be on the toolbar itself? If that is the case, would I have to make two seperate buttons and then hide the one that isn't the current state?
2) Is there a general place to find groups of generic button bitmaps or do I need to make my own?
thank you in advance. I appreciate all the help I have gotten here in the past and in the future.
Thanks.
Dan Willis
|
|
|
|
|
Hello,
Hopefully this helps...
groover4life wrote:
1) when setting up a button on a tool bar to be multiple state (i.e. start/stop) and I want to change the bitmap displayed on the button, how do I change the bitmap on the button?
The following code should help.. I create a function so that if a button is pressed and the bitmap needs to be changed.. change the bitmap for the whole tool bar (to either ON or OFF).. if a button is pressed and you dont need to change the bitmaps don't run the following... You get the idea..
You will need to create 2 bitmaps for the tool bar.. one for "ON" and one for "OFF".. both these bitmaps need to be in your resoruces tab..
HIMAGELIST hOld = (HIMAGELIST)::SendMessage(m_wndToolBar, TB_GETIMAGELIST, 0, 0);
ImageList_Destroy(hOld);
CImageList imageList;
CBitmap bitmap;
bitmap.LoadBitmap(IDB_OFF); <-- BITMAP IN RESOURCE
imageList.Create(16, 16, ILC_COLORDDB|ILC_MASK, 3, 1);
imageList.Add(&bitmap, RGB(255,0,255));
m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
imageList.Detach();
bitmap.DeleteObject();
HIMAGELIST hOld = (HIMAGELIST)::SendMessage(m_wndToolBar, TB_GETIMAGELIST, 0, 0);
ImageList_Destroy(hOld);
CImageList imageList;
CBitmap bitmap;
bitmap.LoadBitmap(IDB_ON); <-- BITMAP IN RESOURCES
imageList.Create(16, 16, ILC_COLORDDB|ILC_MASK, 3, 1);
imageList.Add(&bitmap, RGB(255,0,255));
m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
imageList.Detach();
bitmap.DeleteObject();
groover4life wrote:
2) Is there a general place to find groups of generic button bitmaps or do I need to make my own?
I'm sure you can find them some where.. I usually just make my own..
Hope this helps..
Rob
|
|
|
|
|