|
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!
|
|
|
|
|
I want to remove Close button "X" from the right corner of Dialog, but still want to keep the system menu at the left corner. Unchecking the system menu option from dialog properties also removes the menu at left.
Plz Help.
kriaz.
|
|
|
|
|
I know of no way to remove the "X" while keeping the system menu. You can always just ignore the clicking of the "X".
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there anybody who can tell me how i can set the paper-orientation of the
printer. I have searched some different books or sites about the printing-subject but i haven't found anything about setting of the orientation.
J Vriend
e-mail: JVriend@ooms.nl
|
|
|
|
|
There you go... I have found it somewhere in CP but cannot remember where.. so apologies to the person who deserves credits!
<br />
void CYourApp::SetPrintOrientation(bool isLandscape)<br />
{<br />
if ( isLandscape )<br />
{<br />
PRINTDLG pd;<br />
pd.lStructSize = (DWORD)sizeof(PRINTDLG) ;<br />
BOOL bRet = GetPrinterDeviceDefaults(&pd) ;<br />
if (bRet)<br />
{<br />
DEVMODE *pDevMode = (DEVMODE*)::GlobalLock(m_hDevMode) ;<br />
pDevMode->dmOrientation = DMORIENT_LANDSCAPE ;<br />
::GlobalUnlock(m_hDevMode) ;<br />
}<br />
}<br />
else<br />
{<br />
PRINTDLG pd;<br />
pd.lStructSize = (DWORD)sizeof(PRINTDLG) ;<br />
BOOL bRet = GetPrinterDeviceDefaults(&pd) ;<br />
if (bRet)<br />
{<br />
DEVMODE *pDevMode = (DEVMODE*)::GlobalLock(m_hDevMode) ;<br />
pDevMode->dmOrientation = DMORIENT_PORTRAIT ;<br />
::GlobalUnlock(m_hDevMode) ;<br />
}<br />
}<br />
}<br />
And does someone know how tabs can be displayed properly in CP?
|
|
|
|
|
> And does someone know how tabs can be displayed properly in CP?
Try using <pre> rather than <code> to surround your code snippets .
--
Andrew.
|
|
|
|
|
I’m about to make a SAFEARRAY and pas it into a this function:
<br />
void IAcadSelectionSet::AddItems(const VARIANT& pSelSet)<br />
{<br />
static BYTE parms[] =<br />
VTS_VARIANT;<br />
InvokeHelper(0x7, DISPATCH_METHOD, VT_EMPTY, NULL, parms,<br />
&pSelSet);<br />
}<br />
At first I don’t really know why I know the pSelSet is a SAFEARRAY.
I know I have to do something like:
<br />
VARIANT var;<br />
VariantInit( &var );<br />
var.vt = VT_ARRAY;<br />
But when I do then do this call:
<br />
myIAcadSelectionSet.AddItems( var );<br />
it craches!!
Of course the array is empty but would the call crash cause of that?
I’m soon clear with the meaning of COM-calls but now I’m stucked.
_____________________________
...and justice for all
APe
|
|
|
|
|
This will generate a safe array of BSTRs. Hope the example helps.
VARIANT var;
int nSize = <enter size here>;
VariantInit(&var);
var.vt = VT_ARRAY | VT_BSTR;
SAFEARRAY* pSA;
SAFEARRAYBOUND bounds = {nSize, 0};
pSA = SafeArrayCreate(VT_BSTR, 1, &bounds);
BSTR* bstrArray;
SafeArrayAccessData(pSA, reinterpret_cast<void**>(&bstrArray));
for (int i = 0; i < nSize; i++)
{
bstrArray[i] = <enter data here>;
}
SafeArrayUnaccessData(pSA);
var.parray = pSA;
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)
|
|
|
|
|
Perfect!! And Really thanks!
Don't reply to this if you don't have time...
You made an array of BSTR.
Howto if I'd like to make an array of VT_VARIANT's containing BSTR's?
I'm starting to become a VARIANT-friend soon.
_____________________________
...and justice for all
APe
|
|
|
|
|
Why not have a play with the code and see what you can do?
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)
|
|
|
|