|
its called enthusiasm
damn fine quality too ... why i remember when i was a youngster ...
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I remember when I was a youngster, but the memory is fading fast... ( I'm 32, and everyone else here is barely 20 ).
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hello,
I would like to know if it is possible to insert an item(i mean a string) on two lines in a List Control.
I try something like this but it doesn't work:
MyListCtrl.InsertItem(0,_T("my great \nstring..."));
Thanks for help
Gero
|
|
|
|
|
I made image-bar program to manage in window
It is operated in win98 well but
It isn't operated in win2000
I want to know each image management method.
quickly!!!-_-;;
|
|
|
|
|
Pl. do let me know using VC++, how to convert a custom file format PDS(Picture description format) to PDF format used in the acrobat.
Although this can be done when you print the document using the adobe acrobat distiller, but how this can be done programatically.
How to convert this format to a GDI Format. Please give some ideas on this.
With Regards,
K M Bansal.
|
|
|
|
|
hi,
you can get the acrobat pdf sdk for converting files to pdf format.
if you are talking about the image on the client dc .. you can save it to metafile and do the necessary conversion.
hope this helps
Cheers
Kannan
|
|
|
|
|
How to create a CButton array, and how to use it like Create(),
I implement it :
CButton* m_Button;
m_Button->Create("Button1",WS_VISIBLE|WS_CHILD|WS_TABSTOP,rect,this,1111);
I run it ,and have some problem, then crash ....
please help me ...
thanks.....
|
|
|
|
|
CButton* m_Button;
m_Button->Create("Button1",WS_VISIBLE|WS_CHILD|WS_TABSTOP,rect,this,1111);
You defined a pointer to a CButton object but you have not allocated space for it. The pointer points to some memory space for which you do not own and is not a CButton object. So when you call Create on the m_Button pointer it will crash because you are accessing an address space for which you do not own.
Add "= new CButton()" to the end of your CButton* m_Button declaration like so:
CButton* m_Button = new CButton();
Then you can call Create on the pointer.
Regards,
-Erik
|
|
|
|
|
Dear Eric,
I use the declaration u tell me like so :
CButton* m_Button = new CButton();
and happen an complie error like so :
error C2258: illegal pure syntax, must be '= 0'
error C2252: 'm_Button' : pure specifier can only be specified for functions
why, and how to fix it.
Regards,
Vistac
|
|
|
|
|
It sounds like you are trying to instantiate your m_Button member in an abstract class.
Regards,
-Erik
|
|
|
|
|
Hi,
My software needs some drawing tools, which need to be drawn transparently over a bitmap. The tools include:
-> Line, freehand, text, etc.
-> A 'cup to disc' tool. Essentially this is two circles, one inside the other. They are dragged by the user to a particular spot on the image (which is why they have to be transparent) and the software calculates the ratio of the area of one circle to the next.
Now being my naive self, I thought "Jee, if i made the cup-to-disc tool a windowless activex control i won't have any messy message handling in my view's mouse message classes, because the activex control will receive all the messages". You'll probably notice that the cuptodisc tool not only needs resizing but also repositioning in the container. Well I got all working, except:
-> After about 30seconds of moving the tool around, I start getting first-chance exceptions and finally an unhandled exception which bombs the software. I've since found out this could have something to do with a bug in MFC (Q192942) which causes a stack overflow... Great
-> In my CCupToDiscCtrl::OnLButtonUp() function if the tool is being moved I call:
<br />
myRect.SetRect(point.x, point.y, point.x + 20, point.y + 20); <br />
if (!SetRectInContainer(&myRect))
TRACE("Fail set rect!\n");<br />
But I might click on the tool and drag it to the bottom-right of the screen, and it ends up in the top-left! Or I drag it down and it goes up! And resizes! Note that in my OnDraw I only draw within the confines of rcBounds. Its driving me crazy...
So the point of all this is:
1/ Do I swallow my pride and dump this whole windowless ActiveX thing? It works well if it wasn't for the damn crashing and the fact it doesn't go where I want.
2/ What other options do I have to implement this? Assuming the number of tools may grow to 12 or more, what's the best way to lay them out so my windows message handlers and View's OnDraw stays relatively clean? I saw the JTDraw example on Codeguru and it seemed to be getting too noodle like for me (not quite spaghetti . Is making the View a OLE container going to help?
Thanks for any help. Sorry for my ramblings... but I've run out of options
|
|
|
|
|
Only you can answer question one, but I'd suggest that whatever you do, you'll find there are hurdles. If it were me, I would stick with it, on the basis that I refuse to be beaten by a machine. If it was for work and it was taking too long, I'd do something else and fix it in my time, as a matter of pride. However, I have some serious issues, so take this as a comment on my state of mind rather than advice...
As for question two, in my paint program I created a virtual base class for drawing tools, and put in functions for every message that a tool is likely to use ( OnLButtonDown, OnMouseMove, OnDraw, OnPrepareDC, etc ) and then put the appropriate code in each derived class. So my view class looks like this:
CGrausPaintView::OnMouseMove(CPoint point, etc)
{
PaintTool->OnMouseMove(point, etc);
}
Much cleaner and easier to extend.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
|
look at following code:
STDMETHODIMP CADOTier::OpenRecordset(VARIANT query)
{
VARIANT v;
V_VT(&v) = VT_DISPATCH;
V_DISPATCH(&v) = (IDispatch*) m_connection;
// Need the AddRef() as VariantClear() calls Release(), unless fAddRef
// false indicates we're taking ownership
//
V_DISPATCH(&v)->AddRef();
return m_recordset->Open(query, v, adOpenDynamic, adLockOptimistic, adCmdText);
}
It is a method Implementation of a COM object. It uses another COM object method "open" to open a recordset with a parameter of IDispatch interface type passed--v.
But who can tell me why I must call V_DISPATCH(&v)->AddRef() to increase reference count and where the reference count will decreased?
(VariantClear ? But not find here)
TKS
|
|
|
|
|
I have an array, containing a CStringList and another CArray. Is there an easy way to copy a CStringList or another CArray short of manually iterating through each element, copying it over each time???
// in .cpp file somewhere...
CArray <ctable, ctable&="">* m_parrTables;
// in .h file
class CTable : public CObject
{
public:
CString m_strTable;
CStringList m_lstParents;
BOOL m_bProcessed;
CArray <crule, crule&="">* m_parrRules;
CTable& operator=(const CTable& a)
{
m_strTable = a.m_strTable;
m_lstParents = a.m_lstParents; // ?????
m_bProcessed = a.m_bProcessed;
m_parrRules = a.m_parrRules; // ?????
return *this;
}
}
|
|
|
|
|
A CStringList is exactly that: a list. As a result, there is no way of copying the elements apart from iterating through them.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I want to change the text that the clock displays. I've subclassed the window and intercepted the WM_SETTEXT message, but it only changes the windows text in Spy ++, not the displayed text. How do I do this?
Greg J. Hedlund
SuperStar
|
|
|
|
|
I am using this function to get the serial number of a hard drive. However, it doesn't work when running under Win 9x and trying to get the serial no. of an NTFS partition (e.g. Win 9x workstation trying to get serial no. of NT server partition). It always returns 0. Is there any way around this?
|
|
|
|
|
I want my application which is written with VC to support Multiple language. i did the follow:
first, i put resource to dlls, each dll is for one language,
then,
CMyApp::InitInstance()
{
int nLang = detect_which_language_to_use();
CString strLang;
strLang.Format("Lang%d.dll", nLang);
//load the resource
HINSTANCE hInstance = ::LoadLibrary(LPCTSTR(strLang));
ASSERT(hInstance);
::AfxSetResourceHandle(hInstance);
}
it works. but now i want to let the user choose the language, that is, i add a menu in my program, user can choose the language he want by clicking the menu.
how can i do these? thanks.
hs
|
|
|
|
|
Hello, the codegurus around the world.
Before you make the multi-language application, you had better consider the followings.
For example,
1) English Windows 9x can't show Japanese corretly.
2) Some Japanese user can't understand English.
So, what language will you use for the menu item? English??
At the menu, we can use CDialog class with the radio button something like that
for the user to select the language....
But before that, you must solve some problems....
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
i change the resource(AfxSetResourceHandle) by clicking a menu item, then i show new a dialog,my program use the dialog accord to my choice, but the GUIs which had been showed was not effected.
|
|
|
|
|
Hello, the codegurus around the world.
Actually, I don't understand your problem very well,
but if I guess....
After the code passes the point of AfxSetResourceHandle, the application can't change
the resouce DLL. (However, we may use FindResouce API function for each resouce ID..?)
So, before AfxResourceHandle is called, we must choose which resouce DLL will be used.
As a result,
CMyDialog dlg (AfxGetMainWnd()); // for the bug of Windows ME.
dlg.DoModal(); // with the radio button ?
// Get the data which the user selects as the language from the dialog;
if (sLang == EN)...
HINSTANCE hInst = Loadlibrary (someDLL);
if (hInst)
AfxResourceHandle(hInst);
......
// After this, we can't change resouce DLL.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
actually masaaki you could put a menu of bitmaps of flags to select the language you wanted as they do on many web sites
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hello, the codegurus around the world.
lauren:
I am already working for the other part of bitmaps for the international language.
However, if we use the international language by bitmap format,
we had better be careful about the appearance of this.
For example, like the menu,
1) Japanese (normal letter on Dialog) - (Japanese) by bitmap.
This bitmap had better have the same color of the background like the dialog
as well as the same size of the font as the normal letter of dialog.
As a result, we work more than we expect ....
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I began writing a program on one of my computers the other day, and I decided to work on it on different computer later on...I zipped the source code files, and moved them to my other computer...now that I have unzipped them, and resumed working on my program, I have no problems compiling, or anything like that, but instead the menu that pops up when trying to access a function with the dot operator will not show. Any ideas? When I use the -> operator, a menu comes up, but not with the . operator.
Thanks again.
|
|
|
|
|