|
look at the definition of struct _finddata_t the attrib member
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Does this also work for directories?
Thanx,
Geert
|
|
|
|
|
yes, look at the MSDN, it says
_A_SUBDIR
Subdirectory. Value: 0x10
Or use FindFirstFile
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Imagine the following situation: I pass the address of
an integer varialbe of process A to process B, and have
process B to write a value to this address.
1> would an Access Violation exception be DEFINITELY
raised?
2> if process B happens to have a non-constant variable
(i.e. writable) locating at the same address as the one
passed to it, would an AV exception be raised? if not,
does that mean process B would simply change its own
variable value?
Thanks a lot!
Wenrich
|
|
|
|
|
You can't share memory between processes like this. You have to use memory mapped files.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
|
Anytime you cross the process boundary, you've got to use specialized APIs. If the need is to do so is simple, just use ReadProcessMemory , or WriteProcessMemory which are 2 standards WIN32 API functions.
|
|
|
|
|
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.
|
|
|
|
|