|
By using SetCapture in LMBDown you can make your window continue to recieve the events when your mouse leaves the window. You can also use OnMOuseMove to check your position and limit it ( you'll still need setcapture to get the message ) but limiting a users mouse movement is almost never a good idea. Don't forget to call REleaseCapture in LMB up.
Use a ScrollView and you get the scrollers for free
A scrollview will probably fix problem 3 as well.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Sorry guys I'm pretty new to ATL and COM stuff. The project is a shell extension with MFC support. Been looking at the tutorials on it over and over but can't find out how to fix this problem. After starting a new project I can get it to work. Then after compiling a few times (changing nothing) it starts giving this link error. It doesn't start after any specific number of compiles, but once it starts occuring it doesn't go away.
Linking...
mfcs42.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
mfcs42.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj); second definition ignored
Creating library ReleaseMinSize/program.lib and object ReleaseMinSize/program.exp
ReleaseMinSize/program.dll : fatal error LNK1169: one or more multiply defined symbols found
I can start a new project, transplant the code, and have it working for a while till I get this again. I've had to include afxcmn.h, and change my .cpp files to automatic use of precompiled headers. But apart from that I've not really changed anything. I can get the code to work fine in a nonMFC dll (without using MFC components). Removing all MFC statements I've added doesn't help either.
Any idea on how to fix this?
Thanks
-Neil
|
|
|
|
|
Try removing _ATL_MIN_CRT from the Preprocessor settings.
I think this essentially tells the compiler that you don't want to link with the C runtime, so it creates its own dllmain. Somewhere in your code, however, you are calling CRT functions, so the lib gets pulled in and voila - two dllmains.
You might be able to avoid this by using the 'el' versions of the CRT - e.g. lstrcpy for strcpy.
|
|
|
|
|
Thanks for the reply.
I haven't got _ATL_MIN_CRT in my preprocessor definitions it seems. This is what I have:
WIN32,NDEBUG,_WINDOWS,_WINDLL,_AFXDLL,_MBCS,_USRDLL,_ATL_DLL
Removing _ATL_DLL doesn't seem to help. Removing _AFXDLL creates more errors ofcourse.
The strange thing is I can link the project after creating a new one, and notice no differences in any project settings after it starts having this link error.
I've tried deleting some different generated files but that hasn't helped so far either.
Any ideas?
Thanks
|
|
|
|
|
Sorry guys, fixed it now. I was using memset and including memory.h in one of my classes which seemed to cause it. Although I could comment out the memset and include statements, build it, uncomment them and build again and then it'd work. Although gives a warning:
LINK : warning LNK4089: all references to "MSVCIRT.dll" discarded by /OPT:REF
Which is good I guess. Can't see any options or flags that may have changed to cause this though.
|
|
|
|
|
I have a sample project of a nice looking plot.
When I print it, it prints out the size of a dime
rather than using the entire sheet of paper.
Can I please, please, please, email this project
to someone, anyone and hopefully make it print
bigger?
Any response any one can give me will be greatly
appreciated.
My email address is brinasas@yahoo.com
|
|
|
|
|
try this:
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(CSize(72, 72));
pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX), pDC->GetDeviceCaps(LOGPIXELSY));
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I need read a file and search for certain keywords and extract the string following that keyword.
I have read through the functions CFile::Read, CStdioFile::ReadString, GetPrivateProfileString functions, but they dun exactly meet my requirements.
the closest function is CStdioFile::ReadString, where I have t indicate the number of chars to read from the file. but how can I ensure that I have retreieved the whole line of text in a file, since i do not knwo how long the line is.
Is there other methods/ functions which i can use to extract data from a file?
pls help. thanz in advance
|
|
|
|
|
There are two ways to use the CStdio::ReadString method. The first is to pass a reference to a CString object and the entire string will be read into the referenced object. This is usually the simplest way of doing this. The second method is to allocate a buffer that is larger than the largest string you ever expect to read. You can then use the method that accepts a buffer pointer and a value that represents the size of the buffer. If you do not know what the largest string is you will read, then I suggest you use the first approach.
a).
CString strReadData;
FileToRead.ReadString(strReadData);
b).
char szBuffer[MAX_STRING_EVER_TO_READ+1];
FileToRead.ReadString(szBuffer, MAX_STRING_EVER_TO_READ);
Chris
|
|
|
|
|
In my situation there is one 'server' (Win2000) and there are numerous 'clients' (Win95/98/ME/NT/2000). Both server and clients have modems, but no internet connection.
Now the question is very simple (even though haven't found a simple answer yet): how can I send a file from the server to a client using the modems? I've looked at RAS, TAPI and other complicated stuff , but surely there must be an EASY way to do this.
Structured programming vs. chaotic mind boggling
|
|
|
|
|
you could use the old zmodem transfer protocol (or any of the others) but i don't know where to find a class that does it (sure there must be a CZModem() somewhere...)
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
hi i hve requirements in UK on VC++ with MFC/COM in telecome and embeded systems with 2.5 years exp. and also on GSM. if aou ar ethe on esen dyour cv to naidumg@yahoo.com
Mohan
|
|
|
|
|
hi all!
I have a CFormView, in a split window, and would like to remove the <very> sunken border that is drawn around the edges of the form view by default. Not sure if the border is part of the form or the frame ....
any help very appreciated,
Nick
|
|
|
|
|
Hi Nick - tweak the CREATESTRUCT in the view's overloaded PreCreateWindow...
BOOL CMyFormView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style = WS_CHILD | WS_VISIBLE;
return CView::PreCreateWindow(cs);
}
|
|
|
|
|
Hi
I am beginner in VC++. I have got a CTreeCtrl in my application from which I want to delete HTREEITEMs upon press of delete key. First I proceed to delete the related data structure for the HTREEITEM selected. Then I proceed to delete the HTREEITEM using the DeleteItem(HTREEITEM) method. If the HTREEITEM to be deleted is a folder with numerous sub items with in it, do i need to delete all sub items individually before deleting the parent HTREEITEM ?
OR could i directly delete the parent HTREEITEM ?
Please help me out on this.
Thank You,
Jayanand.
|
|
|
|
|
Hi
You can handle the TCN_DELETEITEM message that the tree control will send whenever an item is deleted ... this will happen for each child item after you delete a parent item manually.
sorry this answer is a bit brief.
Nick
|
|
|
|
|
Hi
You can handle the TCN_DELETEITEM message that the tree control will send whenever an item is deleted ... this will happen for each child item after you delete a parent item manually. You can delete the data for a child item when this message is sent.
sorry this answer is a bit brief.
Nick
|
|
|
|
|
Hi Nick,
Thank U very much for the reply. Ur mail was brief but informative.
Thanks,
Jayanand.
|
|
|
|
|
How to add a button to title bar ,such as minbutton,maxbutton,thanks!
|
|
|
|
|
You have to process (or handle - don't know English pretty nice ;( ) WM_NCPAINT message...
You have to draw all you custom buttons as reply to this message...
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@mailru.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
What is the easiest way to append a DWORD (the result from GetTickCount in this case) to a BSTR, the following works but I know there must be an easier way:
CComBSTR szString = "";
char szStartTime[11] = "";
sprintf( szStartTime, "%ul", GetTickCount() );
szString.AppendBSTR( szSessionID );
szString.AppendBSTR( szSep );
szString.AppendBSTR( szIPAddress );
szString.AppendBSTR( szSep );
szString.Append( szStartTime );
And the following doesn't work (much to my dismay):
CComBSTR szString = "";
DWORD dwStartTime = GetTickCount();
szString.AppendBSTR( szSessionID );
szString.AppendBSTR( szSep );
szString.AppendBSTR( szIPAddress );
szString.AppendBSTR( szSep );
szString.Append( dwStartTime );
I also tried casting the DWORD as different types but none of this worked. Any suggestions. Thanks.
|
|
|
|
|
Hi !
May be it's the one you'was looking for?
#include <sstream>
using namespace std;
sstringstream ss;
ss << LPCSTR(szSessionID) << LPCSTR(szSep) << LPCSTR(szIPAddress)\
LPCSTR(szSep) << ULONG(::GetTickCount());
CComBSTR szString(ss.str().c_str());
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@mailru.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Hi
I would like to add a context-sensitive help menu into my current MDI project. Does anyone know how to do this?
Thank you
kk9
|
|
|
|
|
hi,
i want to use an edit control in a idockingwindow in the right pane of the explorer.
the problem: if i press backspace to del the last letter in the edit control, the explorer goes one level up in the directory.
so, how is it possible, to use the backspace (and all the other special keys) for the edit?
thanks
|
|
|
|
|
You need to implement IInputObject and the appropriate methods to get the backspace to work correctly when your docking window has focus. I am in the process of a couple articles that explain this and other things within Explorer bands and toolbars.
If time permits hopefully this week 1 or 2 of the articles will come out.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|