|
thx anyway.
thats the way people solve problems here. nobody know everything. everyone know only some specific part.
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
HI.
I would like to print the view as seen by CFormView. I put some static labels and buttons on the screen and try to print it out. I used a technique that I saw on Codeproject. I put
SendMessage(WM_PRINT, (WPARAM) pDC->m_hDC , PRF_CHILDREN | PRF_CLIENT| PRF_NONCLIENT | PRF_OWNED);
In the OnDraw function that will let the child controls print out. I can get things to print but the coordinates seems to go away so that everything prints in the very upper left hand corner. I am not sure how to retain or shift it to print in position relative to its position on the screen onto the paper. has anyone seen this?
Thanks in advance.
|
|
|
|
|
|
You need to set the DLL as the active project. Then use the appropriate executable when you run the DLL. Breakpoints in the DLL code will then work.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
How can I set DLL as the active project? Well I don't get what you mean. Can you explain more detailed please?
|
|
|
|
|
I normally have a workspace with the executable and all DLL projects loaded into the IDE. With such a workspace you need to choose the Active Project (right click on workspace project and Set Active Project or Set as Startup Project depending on IDE).
You could just generate a workspace for that DLL. NOTE: If there is only one project in a workspace it is always the active project.
It is necessary to point the DLL at an executable that uses it in order to debug the DLL. The IDE will ask you for this when you run the DLL.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
|
Is it your DLL (you have the code)? A system DLL?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
My DLL. But what's the difference if it wasn't?
|
|
|
|
|
If its my dll i would go for a hardcoded breakpoint like pointed by wb
For System DLLs you need the function name and the dll name of course.
you can Determine the exact, unmangled name of the function
then Set BP on {,,dllname}Function <=- special syntax
To Find the true function name u can use dumpbin.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks, but why isn't it possible to use the same syntax {,,dllname}Function for my DLLS?
|
|
|
|
|
Yeah it surely works too, but i would go for a hardcoded breakpoint at the line of my choice
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
the best way is as posted by
Antony M Kancidrowski, but if you have a project with 5 dlls and you want to debug all of them
you can put this in the dll code
_asm int 3;
and the debuger will stop at that line. but now you MUST start the app with a debuger attached, or you will get an exception!
|
|
|
|
|
|
Use Edit|Breakpoints (Alt+F9) and put in the name of the function. Or load the file into VC++, go to the line where you want the BP, right click and use Insert/Remove Breakpoint.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
I have created a List Control in my mfc app using LVS_EX_CHECKBOXES style
now when i try to hide one of the check box using the SetItemState()
SetItemState(0,0,LVIS_STATEIMAGEMASK);
It does hides it but temporarily and whenever i click anywhere around where it was supposed to be it shows it.
any idea?
Saurabh
|
|
|
|
|
I want to use the loaded dll in the new thread,my codes as below:
BOOL CTestDLLDlg::OnInitDialog()
{
hins=LoadLibrary("ShowDialog.dll");//Success
}
void CTestDLLDlg::OnButton1()
{
AfxBeginThread(ThreadFun,NULL);
}
UINT ThreadFun(LPVOID lp)
{
typedef void __stdcall TestChar(char,char* ,int);
TestChar* test=NULL;
test=(TestChar*)GetProcAddress(((CTestDLLDlg*)AfxGetMainWnd())->hins,"TestChar");
if(NULL != test)//Failure
{
char buf[6];
test('c',buf,sizeof(buf)/sizeof(char));
AfxGetMainWnd()->SetWindowText(buf);
return 0;
}
DWORD d=GetLastError();//can not find the given module
return -1;
}
I know if I load the dll in the new thread,it will work well.but I want to know if I used dll in this way,what should I do?
|
|
|
|
|
Hi All,
How to send and receive ARP packets using windows raw sockets. I want to send ARP packets without using MSDN functions.
Thanks and regards,
Chito
|
|
|
|
|
chito wrote:
...without using MSDN functions.
Huh? The MSDN is not an API, but it is documentation/examples of several API. By chance did you mean that you wanted to use raw sockets without MFC?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, I want to use raw sockets with out using MFC.
Thanks,
Chito
|
|
|
|
|
Ok, so how about:
connect()
send()
recv()
accept()
etc
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
We constructed ATL wizards for VC++ 6.0.
We now have to upgrade them to .NET .
From our first trials we identified that some directories have changed, some keywords were updated, but we found very little information in MSDN documentation about general aspects of the process.
For example, there are numbers to give in some files and we found no indications on what are authorized numbers, the risks of conflicts and so on.
Do you know of documents dealing with this upgrade issues ?
|
|
|
|
|
I detect the system log off message according to following codes
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_QUERYENDSESSION)
{
if (lParam & ENDSESSION_LOGOFF)
{
//I want to restart windows,but failed by call ExitWindowsEx(EWX_LOGOFF|EWX_FORCE,0);
//I have got the shutdown privilege for this process
}
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
how can ?
|
|
|
|
|
Marks_Zhua wrote:
...but failed...
This means nothing without a more detailed explanation. Are you getting compiler errors? Linker errors? Fired assertions? Thrown Exceptions? Unexpected results? What exactly is happening?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
For ExitWindowsEx you need to have the SeShutdownPriviledge enabled in your process token.
have a nice weekend!
|
|
|
|