|
Do you create your scrollbars by adding WS_HSCROLL or WS_VSCROLL window style, or it's a child control?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hi,
I have 2 Tables on MS-Access and I use 1 class CRecordSet because these tables are joined. I have no problem to read a recordset like this:
rsMsg.m_strFilter.Format("CLE = %d", lCle );
rsMsgExp.Open( CRecordset::snapshot,_T("Proc"));
if(!(rsMsgExp.IsEOF() && rsMsgExp.IsBOF()))
{
rsMsgExp.MoveFirst();
csToto = rsMsgExp.m_TOTO;
But when I don't want to write (Add or Update a record), it's not possible, the Exception is "Record is on Read Only Mode", why ???????
Thanks a lot ....
|
|
|
|
|
Snapshots are not updateable. BTW: why don't you use CDaoRecordset instead of ODBC-based CRecordset if you're using Access?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
|
So use CDaoRecordset and open it as 'dynaset', not 'snapshot' - pass dbOpenDynaset to CDaoRecordset::Open.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hi,
I have a problem with the COleDateTime class. I have no idea how to do subtraction and addition for two COleDateTime objects. I am used to the VB type of time and date addition and subtraction. Is there a way to do subtraction and addition as in VB date/time?
By the way is there an equalvalent date/time method in VC that is similar to the one in VB?
Your help is greatly appreciated.
leonwoo
|
|
|
|
|
Look at the COleDateTimeSpan class and operators +,-,+= and -= defined in COleDateTime.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Im using dinput.h's GetDeviceState to retrieve the
current mouse cursor position.
Why do I get coordinates returned in the billions???
I get the same result using ints and longs for x&y.
All I want are pixel coordinates within the
range of my window app.
Any help would be much appreciated
Thanks,
Rob
|
|
|
|
|
Says MSDN-
> The mouse is a relative-axis device, so the absolute axis positions for mouse axes are simply accumulated relative motion. Therefore, the value of the absolute axis position is not meaningful except in comparison with other absolute axis positions.
Why don't you just handle WM_MOUSEMOVE events instead? Potentially with a SetCapture() first.
Signature space for rent. Apply by email to....
|
|
|
|
|
As far as I know, GetCursorPos() works very well, this gets your position in screen coordinates, you can use ScreenToClient() after that.
Romeo JUNCU
|
|
|
|
|
hi,
the template was not recognized, in my MFC DLL.
typedef struct
{
CString name;
int age;
}MYSTRUCT;
CList<MYSTRUCT,MYSTRUCT&> myList;
what's wrong then?
Extreme programming. Do the No.1
|
|
|
|
|
I believe you must export your struct from your extension dll. Use AFX_EXT_CLASS macro
Best regards,
Alexandru Savescu
|
|
|
|
|
I've created a dialog based multithreaded application in VC++ 6.0. The problem is that, whenever i close my application in "release" build, the memory error appears. I am unable to discover the problem because this error is not appearing in debug build. Can any one suggest me something ???
The error i am getting in release build while closing application is:
The instruction at "0x004165a3 referenced at 0x00000078. The meemory could not be "read"
|
|
|
|
|
http://www.codeproject.com/debug/
or more precisely:
http://www.codeproject.com/debug/survivereleasever.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I had a very similar experience. In my case, I forgot to fill the iSubItem field of a LVITEM structure. In debug mode, this field is filled with 0xcccccccc or something, but in release builds, it's filled with whatever happens to reside in that memorylocation previously...
If it's not a LVITEM struct, check if you aren't forgetting to initialise a variable somewhere. An overlooked boolean can be enough to crash the program... (happened to me 4 days ago...)
I used this to find the bug:
extern void SendToDebugFile(const char* comment,bool bNew=false)<br />
{<br />
FILE* f;<br />
if(bNew)
f=fopen("Debug.txt","w");<br />
else
f=fopen("Debug.txt","a");<br />
if(f)<br />
{
fprintf(f,"%s\n",comment);<br />
fclose(f);<br />
}<br />
};
Just call this function at specific locations:
SendToDebugFile("Start of function",true);<br />
...<br />
SendToDebugFile("Marker 1");<br />
...<br />
SendToDebugFile("Marker 2");<br />
...<br />
SendToDebugFile("End of function");
The bug will occur between the last marker in the file and the next one. Zoom in on it with more markers.
|
|
|
|
|
You could even rewrite the TRACE macro so it would expand into a call to SendToDebugFile in release builds!
BTW, statements in ASSERT or TRACE macros that gets expanded into void in release builds is a common source of release-doesn't-work bugs. Another is incorrect signatures of message handlers (if you use VC++6.0).
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Why not redirect the standard output (stdout) streaming in a file (output.txt)...
For that, add a Program argument:
=> in your projects setting (in release mode)
=> tab "Debug"
=> category "general"
=> and Program argument = ">output.txt 2>&1"
Now you can use printf("All what you want\n") for debugging your app and the output.txt file catch your stream...
Hello World!!!
from Raphaël
|
|
|
|
|
|
Create new configuration based on Release, but enable debug info generation on C++ and Link tabs of Settings dialog. Execute the program under debugger, try to reproduce error and check the call stack when program crashes.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hi!!
I've created a dialog based application (Multithreaded)in VC++ 7.0. I've only used MFC thread and CFile clases in this application. After linking this application in Release mode, the size of exe found to be 210 KB.
Is there any way we can reduce the size of MFC apps.???
|
|
|
|
|
http://www.microsoft.com/msj/defaulttop.asp?page=/msj/archive/S572.htm
contains good info though
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I have an Access database for students
and want to get record on paper for one student redirected (sent) to
MS Word
can anybody suggest how to do this
|
|
|
|
|
CComvariant var;
CCombstr bstr;
How to convert this var to c-style string safely.Any macro is there.Pl also tell me for converting from bstr to c-style string.
|
|
|
|
|
Actually Mike and Nish have wrote an article which "probably" answers that very question...
Index page...check it out...
http://www.codeproject.com/string/CPPStringGuide2.asp[^]
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
There are some ATL conversion macros declared in ATLCONV.h.
You will need to declare USES_CONVERSION; in the function that will be using the conversion macros. THis macro declares a few variables on the stack.
Then you can use OLE2T(bstr) to convert your bstr to your C-Style string. There are a slew of macros to convert from (A)Ansi to (W)widechar, to (bstr)bstr including (c)constants and whatever else. The convention is to use the format that you are going from like (A)ansi then a 2 followed by the format converting to like a (BSTR)bstr. Your final macro would be A2BSTR().
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|