|
Ok, and? It's common knowledge that a file that does not exist cannot be read from. This is not a code problem.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to create transparent gif file?
|
|
|
|
|
you mean, programmatically ?
use the CxImage[^] library
|
|
|
|
|
Hi everyone,
In programs like powerpoint or AcdSee we can see many Transitions but how can I make these states is it possible with VC++.
Thanks
|
|
|
|
|
By Transitions I presume you mean a slide show like effect? This[^] may help you.
|
|
|
|
|
I am writing the interface in C++ and someone else will write the implementation.
Some interfaces have to have only one son that should be singleton, that is the object of the only son of my interface should be only one in the whole system.
I am using templates to obligate some son class of my interface class to be singleton, but how can I obligate that it will be only one son class of my interface class? (That the implementer will not be able to inherit from my interface class more than once)
Is it possible?
Thanks in advance.
|
|
|
|
|
Make the constructor in your interface private, declare the implementation class as a friend to your interface, and use "public virtual" inheritance of your interface from the implementation class - that'll prevent any other class inheriting, as it won't be able to see the constructor.
See here:
http://www.research.att.com/~bs/bs_faq2.html#no-derivation[^]
The only problem is that the person doing the implementation would be free to change
class Usable : public virtual Usable_lock {
to
class Usable : public Usable_lock {
which would allow somebody to derive from Usable
If you've got control of setting up the instantiation of Usable, then all should be fine, but in the end of the day, there'll always be loopholes if the person doing the development is determined to do things they shouldn't (That's what code reviews are for!)
|
|
|
|
|
Hello Mr. benjymous,
Thanks for the answer!
But in my case the interface class is placed in the H file and the implementation class is placed in the DLL, the DLL #include H with the interfaces, but H with the interface does not know "who" is the implementation class.
The interface is really independant and does not aware about classes that are implementing it.
So the solution you proposed is not really good for my case.
Is it possible in my case?
Thanks a lot in advance.
|
|
|
|
|
Hi.
I was wondering if MFC supplies a MessageBox kind of thing where the output can be formatted. Some thing like the good old printf:
printf("Hello! Your are customer number %d \n", CustomerNumber);
That would make it possible for me to output my variables to messagebox. Any other way is also cool, except the one with having to write my own custom window.
Abhishek
It is impossible to change your past. But it is very possible to ruin your present by worring about the future.
-Chankya
|
|
|
|
|
Use CString and the Format() method:
CString str;
str.Format(_T("Hello! You are customer number: %d"), CustomerNumber);
AfxMessageBox(str);
|
|
|
|
|
Thanks a lot Mike.
Abhishek
It is impossible to change your past. But it is very possible to ruin your present by worring about the future.
-Chankya
|
|
|
|
|
In addition to Michael's suggestion, there's also AfxFormatString1() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I would use the TRACE macro to output variable in the output window in the DEBUG mode, instead of using message box.
|
|
|
|
|
Hello
I have created a map which looks :
typedef map <char *,="" int,="" ltstr=""> MapData;
where ltstr is the comparator I use.
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
I want to use the function equal_range in algorithm class.
and to use my comparator, but I don't know how define the comparator for this function.
Does anyone know ?
Thanks,
Clint
|
|
|
|
|
Hi,
I have a wmv file. Now I want to add a application specific data into wmv file. Is this possible and allowed? How can I achive this?
Regards,
Hemant.
|
|
|
|
|
|
Hi,
Thanks for your reply. I am using Windows media format SDK. Can you just give some details(It will be great if you can post some code ) about how can I achive this.
Regards,
Hemant.
|
|
|
|
|
To modify metadata in an existing wmv file use a metadata editor object, obtained with
WMCreateEditor().
Use the returned IWMMetadataEditor interface IWMMetadataEditor::Open() method to open the wmv
file.
Use the IWMMetadataEditor interface to obtain an IWMHeaderInfo3 interface (using QueryInterface()).
IWMHeaderInfo3 has member functions to get, add, modify, and delete attributes (individual
metadata items).
There's an extensive list of pre-defined attributes in the Media SDK and you can define your
own as well
|
|
|
|
|
Hi,
Thanks for reply. I think this will solve my problem.
Regards,
Hemant
|
|
|
|
|
Hi all,
I builded an application in VS2003 ,which was developed in Visual Studio 6.0, i'am facing a error called "error PRJ0019: A tool returned an error code from "Register OPC Server" " , can any one help me in solving this problem
Thanks,
mpk1979
1979
|
|
|
|
|
I want my console app program loop echo some number,until press a key as "Enter" or "Q".
cout<<"Please input the number:";
while(cin.get()==0x0a)//how to set the condition?
{
for(int i=1; i<=99999; i++)
{
cout.width(5);
cout<<i;
cout<<"\b\b\b\b\b";
="" }
}
thanks!=""
<div="" class="ForumSig">The name is Sand, BlueSand!
|
|
|
|
|
I have been trying all night to get this working, but it just doesn't want to budge. I am overriding WM_NCPAINT to draw custom borders to the non-client area of my window. My new borders come from 8 bitmap images and may not straight lines. To paint them, I create 8 Regions (from transparent pixels in the images) and apply this to the clipping region of a DC retrieved from GetWindowDC(). The painting works exactly as I want. To handle the WM_NCHITTEST, I need to call PtInRegion() to check if the cursor is over a border, the problem is I am unable to correctly map the POINT retrieved from the lParam of WM_NCHITTEST to give an accurate result.
The following gives the correct value for the top and left borders, but the right and bottom values are within the client area. Infact they are offset from the 'real' border by 2 times the width of the new width I gave in the WM_NCCALCSIZE handler.
case WM_NCHITTEST:
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
RECT rc;
GetWindowRect(hWnd,&rc);
pt.x -= rc.left;
pt.y -= rc.top;
return HitTest(pt);
If in WM_NCCALCSIZE I set the borders to 0 width, the above works, but this defeats the object of painting borders in the non client area rather than the client area.
Could somebody please help me out with this?
|
|
|
|
|
Your HitTest() function takes coordinates relative to what?
|
|
|
|
|
relative to the top left corner of the window (the non client area).
|
|
|
|
|
WM_NCHITTEST looks ok but the system has the wrong window rect as you know.
What's going on in the WM_NCCALCSIZE handler?
|
|
|
|