|
To my knowledge, Visual Studio must start the application in order to debug it.
|
|
|
|
|
put __asm{ int 3 }; at the beginning of the code!
when the exception is raised, attach visual studio debugger to it, voila
Don't try it, just do it!
|
|
|
|
|
I am conecting to MYSQL database which is on the server using following code.
CDatabase m_dbftp;
m_dbftp.OpenEx(sDSNName,CDatabase::noOdbcDialog | CDatabase::useCursorLib );
Connection is done properly. I want to catch the exception
when server is disconnected.
I am using following code
catch(CDBException* pEx )
{
CString sz;
if ( pEx->m_nRetCode == AFX_SQL_ERROR_CONNECT_FAIL )
AfxMessageBox("myconnection failed");
}
It dose not work
Problem is m_nRetCode contains -1 instead of
AFX_SQL_ERROR_CONNECT_FAIL .
I am not able to identify if server is disconnected .? How to do it.
|
|
|
|
|
I see a sentence like below:
private Mutex[] m_mutex;
It seems very strange for me
What is its meaning?
Help
Thank you
|
|
|
|
|
Short for MUTual EXclusion. These are used to non-recursively synchronize access to shared resources. Eg: in order to protect a critical section, you can use a mutex, which will ensure that only one thread at a time can lock it.
|
|
|
|
|
It looks like a syntax error to me. The private keyword should have a colon after it, and the square brackets should follow the variable, not the type.
private:
Mutex m_mutex[];
If it's something different, it's new to me.
|
|
|
|
|
DavidCrow wrote:
It looks like a syntax error to me. The private keyword should have a colon after it, and the square brackets should follow the variable, not the type.
private: Mutex m_mutex[];
If it's something different, it's new to me.
I think that's Java, or may C#. In Java, you denote the accessability of each member explicitly. Correct me if I'm wrong, its been a while since I used Java, arrays of a type are written as TypeName[] variableName.
|
|
|
|
|
|
You can find the codes at the following site:
http://www.codeproject.com/useritems/inprocsemaphore.asp?target=semaphore
|
|
|
|
|
Shouldn't C# questions be posted to the C# forum instead of the VC++ forum? You're bound to get more answers that way!
|
|
|
|
|
Is there any way to programatically set/unset fullscreen console mode?
Neil
|
|
|
|
|
hi..
this way is not exactly same yours however you can use.
<br />
void CMainFrame::OnViewFullscreen() <br />
{<br />
if (m_fullscreen)<br />
{<br />
ModifyStyle(0,WS_CAPTION|WS_THICKFRAME); <br />
ShowWindow(SW_SHOWNORMAL);<br />
<br />
ShowControlBar(&m_wndToolBar, TRUE, FALSE);<br />
ShowControlBar(&m_wndStatusBar, TRUE, FALSE);<br />
}<br />
else<br />
{<br />
ModifyStyle(WS_CAPTION|WS_THICKFRAME,0); <br />
ShowWindow(SW_MAXIMIZE);<br />
<br />
CFrameWnd* pChild = GetActiveFrame();<br />
if (pChild) pChild->ShowWindow(SW_MAXIMIZE);<br />
<br />
ShowControlBar(&m_wndToolBar, FALSE, FALSE);<br />
ShowControlBar(&m_wndStatusBar, FALSE, FALSE);<br />
}<br />
m_fullscreen = !m_fullscreen;<br />
}
|
|
|
|
|
Erm, I was after full screen mode for console (text mode) programs, not GUI
Neil
|
|
|
|
|
hm.. I never did it, but perhaps by finding the window of the
console. and then sending "Alt+Enter" to it?!?
Use EnumWindows(), So you can find the ConsoleWindow. it has
the name of your app in the title.
and then send the "go full screen" magic "Alt+Enter"
|
|
|
|
|
Functional but not very elegant - this sends a Ctrl+Enter to the console window:
<br />
#include <windows.h><br />
#include <conio.h><br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
keybd_event( VK_MENU, MapVirtualKey( VK_MENU, 0 ), 0, 0 );<br />
keybd_event( VK_RETURN, MapVirtualKey( VK_RETURN, 0 ), 0, 0 );<br />
keybd_event( VK_RETURN, MapVirtualKey( VK_RETURN, 0 ), KEYEVENTF_KEYUP, 0 );<br />
keybd_event( VK_MENU, MapVirtualKey( VK_MENU, 0 ), KEYEVENTF_KEYUP, 0 );<br />
<br />
<br />
getch();<br />
return 0;<br />
}
Displaced Aussie. Currently in London, normally living in Melbourne.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
what is a SAFEARRAY?
I am having a hard time understanding the little documentation that I have found. I am interested in constructing one because of this function I have found...
<br />
int CFacedetectApp::RCobj_detectfaces(SAFEARRAY **bmp)<br />
{ <br />
BYTE *bmp2;<br />
int i;<br />
<br />
SafeArrayLock(*bmp);<br />
<br />
bmp2 = (BYTE *)(*bmp)->pvData;<br />
<br />
for (i=0;i<width*height*3;i++) video_image[flip]->imageData[i] = bmp2[i]; <br />
<br />
if (!trackingEnabled)<br />
DetectFaces(video_image[flip]);<br />
else<br />
updateTracking();<br />
<br />
flip = 1-flip;<br />
<br />
SafeArrayUnlock(*bmp);<br />
<br />
return(NoOfObjects);<br />
}<br />
The code is from....
http://www.fuzzgun.btinternet.co.uk/rodney/components.htm#FaceDetection[^]
Why is it so hard just to give a function a simple file name and let it do it's detection
I like his .dlls because they are simplified but I am having trouble understanding them. any help would be great. thanks
Later, JoeSox www.humanaiproject.org
"The worst fad has been these stupid little robots,
Graduate students are wasting 3 years of their lives
soldering and repairing robots, instead of making them smart.
It's really shocking." -Marvin Minsky.
|
|
|
|
|
It's sort of the VB/COM/DISPATCH array type. If you're in MFC, COleSafeArray can be used to manage SAFEARRAYs more easily.
--
Ian Darling
|
|
|
|
|
Ian Darling wrote:
It's sort of the VB/COM/DISPATCH array type. If you're in MFC, COleSafeArray can be used to manage SAFEARRAYs more easily.
ah, perfect thanks, I'll start reading up on COleSafeArray.
Later, JoeSox www.humanaiproject.org
"The worst fad has been these stupid little robots,
Graduate students are wasting 3 years of their lives
soldering and repairing robots, instead of making them smart.
It's really shocking." -Marvin Minsky.
|
|
|
|
|
hello,
I have a big problem ... I have created a MFC app from wizard ... and added:
void CEditorView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = widthMM;
sizeTotal.cy = heightMM;
SetScrollSizes(MM_LOMETRIC, sizeTotal);
}
so, my maping mode is MM_LOMETRIC ...
and in OnDraw ....
void CEditorView::OnDraw(CDC* pDC)
{
CEditorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CDC bdc;
bdc.CreateCompatibleDC(pDC);
CBitmap cb;
cb.CreateCompatibleBitmap(pDC, 1000,1000);
bdc.SelectObject(cb);
bdc.SelectStockObject(WHITE_BRUSH);
bdc.PatBlt(0,0,1000, 1000, PATCOPY);
bdc.SelectStockObject(BLACK_BRUSH);
bdc.Rectangle(CRect(0, 0, 500, -500));
pDC->StretchBlt(0, 0, 1000, 1000, &bdc, 0, 0, 1000, 1000, SRCCOPY);
}
and nothing happens .... why ?????
I tried to change the sign of the coordonate values and still nothing ...
How can I create a compatible DC with my DC and to paint in it ?????
please help !!!.... thanks ......
|
|
|
|
|
...but I not took real time to dig your code enough !
BTW, have a look at my own code (which work in every case), and find out how it works Tips, look in CSkinProgress::OnPaint() !
http://www.codeproject.com/miscctrl/CSkinProgress.asp
Kochise
PS : Use CSkinProgress::ConvBitmap(...) to convert your bitmap from another color map if for instance, you are trying to display a 24 bits/pixel picture on a 16 or 32 bits/pixel screen ! Otherwise you'll get a black/blank screen instead !
In Cod we trust !
|
|
|
|
|
bdc.SelectObject(cb);
try
bdc.SelectObject(&cb);
-c
CheeseWeasle
|
|
|
|
|
Hello everyone.
i'm i got a program that uses the drag and drop class from CP (i think Leon Finker's) and i'm not sure whats causing it, but when in debug mode i drag something from one listview to another, i get "Debug Assertion Failed" on line 1132 of dbgheap.c something about _CtrlsValidHeapPointer(pUserData) and "Damage: before Normal block (#-858993460) at 0x0012D1D8"
I'm have no idea how this is happening, and why, i was hoping someone could help, me, even a good article on debuging would be nice. I'm using WTL as well.
Even when i have the onDrop method do nothing i still run into this error, i can get to line 1186 in dbgheap.c then it wont do anything but break out of running. Its something to do with freeing debug memory from the heap. anybody know anything that could help me?
thanks
Luke.
|
|
|
|
|
Luke Murray wrote:
Damage: before Normal block (#-858993460) at 0x0012D1D8
You (or some code you're using) allocated memory, then wrote outside of the block of memory. In this case, it underran the block and the CRT detected it.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks Michael, that made some sense, and after some more looking into the code, i got it fixed.
Thanks for the reply
Luke.
|
|
|
|
|
Hi!
region is very useful feature in c#. By region, we can organize long file easily.
is there such a feature in vc7?
I know vc7 will hide or show class or method. But does it have a region feature, i hope to use it to split my long #define list manually.
|
|
|
|
|