|
Hi,
I have created one ActiveX controls with ATL ( the control inherits from FullControl), I can put it on the ActiveX container tool that Visual C++ ships, but If I try to copy from there and paste to Word ( for example), then it doesn´t show anything, can anyone tell me why this happens ?
Thanks a lot, Bye
Braulio
/* ---------------
Braulio Díez
Software Programmer
------------------- */
|
|
|
|
|
how to make non rectangle dialog form;)
|
|
|
|
|
use the function "SetWindowRgn" in the "OnInitDialog"-function of the dialog you wish to change
|
|
|
|
|
There is a demo project here on CodeProject illustrating this.
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 use dis function but I whant make dialog form like BMP file;)
|
|
|
|
|
I'm STILL trying to append my MP3 files. I have used Hex Workshop to manually append files that won't write, to prove to myself that the same file will work once it has 128 bytes at the end awaiting inclusion. Now, here's the clincher. I put my code into switch statements to make it easier to follow. The following:
fHandle = CreateFile(filepath,
STANDARD_RIGHTS_ALL,
0,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
SetFilePointer(fHandle, -128, NULL, FILE_END);
WriteFile(fHandle, "TAG", 3, &sentinel, 0);
WriteFile(fHandle, myID3.title, 30, &sentinel, 0);
WriteFile(fHandle, myID3.band, 30, &sentinel, 0);
WriteFile(fHandle, myID3.album, 30, &sentinel, 0);
WriteFile(fHandle, myID3.year, 4, &sentinel, 0);
WriteFile(fHandle, myID3.comment, 30, &sentinel, 0);
WriteFile(fHandle, &myID3.genre[0], 1, &sentinel, 0);
CloseHandle(fHandle);
will rewrite the ID3V1 tag in the last 128 bytes, but replace the -128 with a 0, and nothing. The Write functions return invalid handle. Any suggestions gratefully accepted.
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 solved it - I still don't know why my file would not append, but I found another bug in the ID3 code I am using, which left the handle open if there was no ID3. Now I am using a stream to add 128 bytes, then writing the info out with the above code.
Thank goodness - it only took me two nights. As an aside, am I the only one who programs all day, comes home and works on my own code ? What's wrong with me ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
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?
|
|
|
|
|