|
It's not home work, not an assignment. i just want to find out how exactly
an AV exception is raised. This question is such one that confused me. Please
focus on what would happen under this situation rather than how to do the
"passing". Thank you!
|
|
|
|
|
&& if your OS is Windows
&& if Netscape is your default browser...
Can you please navigate to
HKEY_CLASSES_ROOT\htmlfile\shell
in the registry (of course)
and let me know what the data string along with version of Netscape you are using?
Thanks,
I haven't had time to install Netscape yet on my new laptop and I am on a 56k line
It is for my article:
http://www.codeproject.com/useritems/powermini.asp[^]
and I am fine tuning, and learning at the same time, how windows finds the default browser.
Later,
JoeSox
www.joeswammi.com
"Male Employee #2I have a question Nick, I'm trying to do this quarterly, I just, I can't get the stupid e-mail package to open at all.
Nick Burns: It's the e-mail that's stupid, not you right?"
|
|
|
|
|
im having do an arm animation ..
with the arm consisting of say 3 basic rectangle bitmaps representing the upper arm
fore arm and the
palm..
they all move in the same plane therefore 2d is ok.
movement is to include translation as well as rotation of every arm...
this invludes basically translation and rotataion of the primary bitmaps as well....
as rotation of a bitmap by a specific angle is a tiresome process unless i am to use asm ....
and in this case the rotation will be a major part as for smooth rotation from 0-60 degrees say..requires me to iterate the rotation by an increment until it is 60 degrees.....
ive heard of sprites...do u suggest that i should store the sprites of all 3 arms and then blt the respective sprite based on the degree of rotation....????
i havent come across any sprite examples that dont use directx....is there any??
do advice if any other solution is possible..
Regs
fordge
note:the arm cannot be drwan geometrically and has to be a bitmap
|
|
|
|
|
it depands.
if the arm (bitmap or others) is very large, pre-treat the bitmap is a must.
otherwise it is not neccesary.
OK, say, if the bitmap is smaller than 200*200 pixels on IBM-586 computer (i developed Windows game long times ago, that was my test before), it is not neccesary.
solution is that bitmap must be modified in bitmap buffer, not in DC or memory DC - DCs are too slow.
_asm is recommended but not neccessary.
treating bitmap buffer with _asm is a top ability and intelligent test - if for any kind of color entries, want a challenge?
if a bitmat upto 400*400 pixels can be rotated, moved and displayed with speed over 100 times/per second in a PII-200 machine with backgroud consideration, that is a different!
includeh10
|
|
|
|
|
Hello,
I just started playing around with creating DLL's.. I have created a simple MFC Dll that has one function..
__declspec(dllexport) int ConnectSocket(CString strDns, short nPort);
In this function I start up WinSock create a socket and connect it.. I then close the socket and do Cleanup..
I created a test SDI app to try and use my dll.. It works fine in Release mode and it works fine if I compile a debug.exe and run it but if I try to run it in Debug Mode.. I get an error..
HEAP[Dll Test Container.exe]: Invalid Address specified to RtlFreeHeap( 9a0000, 1361880 )
Any ideas why I'm get this error in debug mode? I am new at this and have no idea what could be causing it.. If you need more info just let me know..
Thanks!
Rob
|
|
|
|
|
I know when you open a socket, heap memory is allocated. I don't do sockets a whole lot (thought the company I work at does), but I don't think you should do WSACleanup while you have a socket open. Do WSACleanup after you have closed all sockets, and maybe that will work.
From the heap error you are having, there's not enough information to decide what's really going on. Include a complete callstack, and I can try to provide some more information.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Actually If I remark out all of my code and just have the function return a value of 0.. It still crashes with the same error.. Here is the callstack..
NTDLL! 77f97704()
NTDLL! 77fb6688()
NTDLL! 77fb58fe()
NTDLL! 77fa7111()
NTDLL! 77fcbeda()
MYSOCKETDLL! 1000211e()
CWnd::OnWndMsg(unsigned int 275, unsigned int 0, long 0, long * 0x0012fd50) line 1829
CWnd::WindowProc(unsigned int 275, unsigned int 0, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x013818d0 {CMainFrame hWnd=???}, HWND__ * 0x000c07b6, unsigned int 275, unsigned int 0, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000c07b6, unsigned int 275, unsigned int 0, long 0) line 368
USER32! 77e3a244()
USER32! 77e145e5()
USER32! 77e15b51()
CWinThread::Run() line 480 + 11 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00133129, int 1) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00133129, int 1) line 30
WinMainCRTStartup() line 198 + 54 bytes
KERNEL32! 77ea847c()
Thanks for helping out
Rob
|
|
|
|
|
Sorry for so long without a reply. So, your function in your DLL doesn't do anything besides return 0 and your app still crashses? Is the module "MYSOCKETDLL" your application or your DLL? If it's your DLL, it looks to me that it's compiled in release mode and maybe you have a .lib mismatch. If it's your app, I don't know why it would have no symbol information, unless it's compiled in release mode as well. What are the compiling and linking details?
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
May be this won't help, but if that's a MFC dll, make sure to call the AfxSocketInit() method before you do anything.
|
|
|
|
|
I'm creating a CEdit in a CView subclass, but the only thing I see is a white box (on the white background), which obviously doesn't look that good.
How can I get the ClientEdge around the CEdit (without painting it myself) ?
This part created the EditBox:
m_FilterEdit.Create(WS_CHILD|WS_VISIBLE, rec, this,0);
I tried:
m_FilterEdit.ModifyStyleEx(0,WS_EX_CLIENTEDGE);
but that didn't work as it should (It did nothing).
I also realized, that the font of the Edit is not the usual font that windows uses in Edits, Listboxes, etc., but some ugly looking default font, so I had to change it manually to ANSI_VAR_FONT. Is that usual behavior or can I create the CEdit with the good looking font (like in dialogs) instantly ?
|
|
|
|
|
I think you need to do the ModifyStyleEx like this..
ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
|
|
|
|
|
I think adding WS_BORDER style to the Create call will do the trick.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
WS_BORDER just gives me a black rectangle.
I'd like to have a 3D-border with shadows, etc. like in dialogs.
I now tried every combination of: with WS_BORDER/without WS_BORDER and ModifyStyleEx with 0 first and 0 second.
No one worked.
|
|
|
|
|
This works fine for me...
if(!m_wndEdit.Create(WS_CHILD|WS_VISIBLE|WS_VSCROLL|ES_MULTILINE|ES_READONLY, CRect(), this, 100))
return -1;
m_wndEdit.ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
or
m_wndEdit.ModifyStyleEx(0, WS_EX_STATICEDGE);
|
|
|
|
|
ok, then I'm doing something basic wrong.
Can you tell me in which function of the View class you have this code ?
|
|
|
|
|
in OnCreate(LPCREATESTRUCT lpCreateStruct) of the CView.. Basically I have an old app (IRC) type app where I created a SDI of CView type and I create 2 edit windows one on the top 90% of the screen and one on the bottom 10%.. I create the windows and set the styles in OnCreate() of the CView.. Then in the OnSize I resize both windows. The top 90% window has the style of WS_EX_CLIENTEDGE and the bottom 10% has the style of WS_EX_STATICEDGE.. it looks just like MIRC..
I could email you a sample.. maybe your doing something a little different than I am.
Rob
|
|
|
|
|
Here is what I am doing...
// In the header...
CEdit m_wndTop;
CEdit m_wndBottom;
// In the source....
int CIRCViewView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
if( !m_wndTop.Create(WS_CHILD|WS_VISIBLE|WS_VSCROLL|ES_MULTILINE, CRect(), this, 100) )
return -1;
if(!m_wndBottom.Create(WS_CHILD|WS_VISIBLE|ES_AUTOVSCROLL|ES_MULTILINE, CRect(), this, 101))
return -1;
m_wndTop.ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
m_wndTop.SendMessage(WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FIXED_FONT));
m_wndBottom.ModifyStyleEx(0, WS_EX_STATICEDGE);
m_wndBottom.SendMessage(WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FIXED_FONT));
return 0;
}
void CIRCViewView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
if( nType != SIZE_MINIMIZED )
{
static const int iHeight = 20;
m_wndTop.MoveWindow(0, 0, cx, cy - iHeight);
m_wndBottom.MoveWindow(0, cy - iHeight, cx , iHeight);
}
}
|
|
|
|
|
Thanks a lot.
Finally by testing this code I got it working, which is all I wanted.
I just got confused. My code changes from "works just fine" to "no clientedge at all" when I add/remove the line:
m_wndBottom.MoveWindow(0, cy - iHeight, cx , iHeight);
I have absolutely no idea what MoveWindow has to do with painting the ClientEdge or not.
But I had to catch WM_SIZE anyway, so I'm happy.
|
|
|
|
|
This maybe the style your looking for too... instead of the ones I suggested..
m_wndTop.ModifyStyleEx(0,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE);
for a border or
m_wndTop.ModifyStyleEx(0,WS_EX_CLIENTEDGE|WS_EX_STATICEDGE);
for a standard edit box..
|
|
|
|
|
I'm working on a MDI application with different menus for the CMDIFrameWnd main frame and the CView child frames. Based on data in each document, I want to dynamically add new menu choices to the menu shown for that child frame. GetMenu() only gives me access to the CMDIFrameWnd main frame menu. How do I get access to the menu for the CView child frame?
|
|
|
|
|
Im not sure if I understand your question 100% but here is how I load a menu for my view... maybe it will help you out.. You could create different menus for each doc or view you have and load them like this..
void CMyView::OnRButtonUp(UINT nFlags, CPoint point)
{
ClientToScreen(&point);
CMenu menu;
menu.LoadMenu(IDR_POP_UP_VIEW);
CMenu* pPopup = menu.GetSubMenu(0);
CWnd* pWndPopupOwner = this;
while(pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN,
point.x, point.y, pWndPopupOwner);
CRichEditView::OnRButtonUp(nFlags, point);
}
|
|
|
|
|
Thank you but I was trying to make changes to the main menu at the top of the application, not a pop-up menu. As it turns out, the solution was simple but a little obfuscated. I had to delete and reload the menu data each time the child frame activated by using GetMenu() called from the main window, not the child frame, and it had to be done when the child frame was activated, not when the child frame's view class was activated, using the ON_WM_MDIACTIVATE event or else I'd wind up getting the menu used when there are no documents instead of the menu for documents. So I had been using the right functions just not in the right places or at the right moment.
|
|
|
|
|
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_TYCATTTYPE,
RUNTIME_CLASS(CTycattDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTycattView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
::DestroyMenu(pDocTemplate->m_hMenuShared);//=pMainFrame->NewMenu();
// pDocTemplate->m_hMenuShared = NULL;
pDocTemplate->m_hMenuShared = pMainFrame->GetMyMenu();
GetMyMenu() prepare your new menu handle
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Hi, apparently, no-one seems to be able to answer my question on newsgroups because I guess it's more complicated than rocket science.
I'll make this real simple. Suppose I have one modeless dialog called, CFirstDialog that gets displayed from the document class upon a menu selection. In the CFirstDialog class, I have an on OnOK handler:
void CFirstDialog::OnOk()
{
// I simply wish to open up another modeless dialog box upon closing this one
m_mySecondDialog = new CSecondDialog(this);
m_mySecondDialog->Create(CSecondDialog::IDD, this);
m_mySecondDialog->ShowWindow(SW_SHOW);
// Calling DestroyWindow destroys this dialog, so the second dialog
// will show, but it will show only for an instant obviouly because
// it's a member variable that gets destroyed when this object is destroyed.
DestroyWindow();
}
How do I make CSecondDialog show up while at the same time closing CFirstDialog? If I don't call DestroyWindow, but say, call EndDialog, then there's a memory leak since it's modeless, but calling DestroyWindow will not enable the second modless dialog to stay created. I know that I could just merely have the document class (the one that opened up CFirstDialog to begin with) open up CSecondDialog, but this would require a bit of strange logic, like setting variables in CFirstDialog to signal that it's closing so that the document class can therefore open up CSecondDialog, but this would require goofy logic, but is this basically the only way? Can anyone please tell me how to solve this tougher than rocket science problem?
|
|
|
|
|
One solution is to show the modeless dialog box after the modal dialog box returns from DoModal().
Kuphryn
|
|
|
|
|