|
another stolen sig.. but he.. i´ve never claimed that it is my sig..
but.. i already knew that.. but my question is...
IS THERE ANYBODY WHO HAS GOT ANY WORKAROUND for this problem...
i really can't believe that you shouldn't be able to draw dotted or dashdotted line on printers.. (i think that it should work with a geometric pen..)... but i couldn't get em going...
thanx for any advice
bernhard
stolen signature #13:
To understand recursion, we must first understand recursion
|
|
|
|
|
Scaling correcting?
LPtoDP?
and don't be so rude to people who *try* and help you!
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
if i´ve been rude.. or if somebody thought that this was rude.. i´m going to apologize..
(cause i´ve found answers to many of my answers in here...)
but the answer of christian didn't help me really out.. and your answer neither.. and so i did want to make it clear that i am still missing a *real* answer..
cause maybe there is a knot in my brain.. but i would like to declare a pen that works both on screen and on the printout.. and.. the dots are on screen to "large"...
this is all i wanted to say..
i know how to scale from lp to dp... but this doesn't help me...
thanks in advance...
bernhard
stolen signature #12:
People who love sausage and respect the law should never watch either one being made
(i really like this one.. chris... thank you...)
|
|
|
|
|
If LPToDp does not help you then you will need to create a bitmap that defines your line pattern and stretchblt it, the same as you need to for pattern brushes. Of course you also need to figure out the size of the print DC, but I presume you've already done that.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
this seems to help me out..
stolen sig #15:
- I heard if you play the Windows CD backwards, you get a satanic message.
- That's nothing, if you play it forward, it installs Windows!
|
|
|
|
|
I want that my dll will be accessed in every foreign language like Delphi or VB. So what can I do ???
|
|
|
|
|
Do you mean having the resources in multiple languages? If so, the usual way is to have one resource DLL per language.
Michael
|
|
|
|
|
- Be sure to export your DLL functions with "C" linkage. Easiest to achive this is to use a module definition file (.DEF).
- Do not use __declspec(dllimport/dllexport), 'cause this exports using so called "decorated names" which are compiler-vendor specific.
- This restricts exports also to plain C functions only. It is not possible to export classes or overloaded functions (because you need decorated names for it).
- Build the necessary import stuff for the other languages, e.g and UNIT for delphi that includes all symbols of your header file.
Daniel
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
Do not use __declspec(dllimport/dllexport), 'cause this exports using so called "decorated names" which are compiler-vendor specific.
This is a false statement. If you have a function with "C" linkage you can safely __declspec(dllexport) it; the name will not be mangled. There's no connection between mangling and __declspec.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you ! But I dont understand you .
I use in my DLL with classes and functions such that :
extern "C" __declspec(dllexport)int Verificat(CString id, CString regfp)
{
MyClass dlg;
dlg.DoModal();
return dlg.ReturnVal;
}
I do it with MFC AppWizard(dll) type: MFC Extension Dll
How can I match it for Delphi ???
|
|
|
|
|
CString is an MFC class, I don't think Delphi will understand the exported function. Try using LPCTSTR or something like that.
Michael
|
|
|
|
|
I want that my dll will be accessed in every foreign language like Delphi or VB. So what can I do ???
|
|
|
|
|
I believe you'll find you need to write a COM dll that includes the functionality in the dll. You should use ATL for this.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
If you write your methods carefully using __stdcall as the calling convention, they should be accessibly from Delphi and VB without needing a COM wrapper.
If you want to turn it into a COM module, have a look at some of the ATL tutorials available and put a wrapper around your functionality.
Dave.
|
|
|
|
|
How do we make a template class into a concrete class
|
|
|
|
|
The compiler does that for you based on every instance of the template class that has different parameters. Or you can simply remove the template declarations and replace all the places the type is refered to with a concrete type.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
|
|
|
How can I do to make a class serializable, a class which is not
derived from a CObject class.
Fred.
Thank for your help
|
|
|
|
|
Hi Fred,
If the type of class you are going to load is fixed, then the solution is simple, add a Serialize(CArchive &ar) method to the class. You create a blank object, a call this function, passing the CArchive reference to it, and hey-presto, you have a loaded class. If you have a class whose type is not fixed, your job is a little harder .. you will still need a 'Serialize' function though. The only reason you need a CObject derivation is because with it, MFC is able to dynamically reproduce the class from file data. But, as you don't have a CObject derivation, you will need to do this manually. In saving you must do three steps,
1. Store an identifyer that defines the name of your class, a string, or a just a token.
2. Get the class to serialize all it's member variables using the Serialize function.
To load you must
1. Read the identifyer that defines the class type.
2. Now you know what type of class to create, create it - like this
3. Ask the class to load it's member variables from the the archive, also using the Serialize function.
The code for loading might look a little like this...
ar >> iClassType;
switch(iClassType)
{
case FISH: object = new CFish(); break;
case DUCK: object = new CDuck(); break;
default: ASSERT(NULL); break;
}
object->Serialize(ar);
You could even define a constructor for the object that took a reference to the CArchive as it's only parameter, so as you construct the object, it deserializes itself!
I hope this all helps
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
I finally finished RC1 of my Movie Database ( with huge thanks to all who helped, especially Norm for getting me over the Connection Points hurdle with the code he sent me ). It a COM dll which is called from an MFC client, and when reading in files, the dll sends back messages through connection points to advise of each filename being scanned, the number of files to be processed ( for a progress bar ) and a message to say it's stopped scanning. My class that catches these messages impliments a progress dialog based on them.
Now the question. I'd like to make the dialog run in a different thread and put a 'Cancel' button on it. I want a different thread so that the GUI doesn't lock up due to the process of reading files, etc. The thing is, how do I tell my dll to stop processing files and just finish with the ones it has ? The obvious way would be another COM method that sets a bool which is checked before I process each file. I have two qualms.
1/ It's ugly. Is there a nicer way to do it ? I'm not concerned about speed, because the time it takes to check a bool pales next to the time it takes to render a video file and establish the data I am storing ( frames, length, size, etc ). I am concerned about doing this well ( the whole point is to learn more about ATL, after all ), so if there is a nicer way of doing it, I'd love to hear it.
2/ If my instance of the COM object is busy processing files, will my other call to set the bool occur right away in another thread, or sit in a message queue and execute when I don't need it anymore, i.e. the files have been read.
Any advice is, as always, appreciated.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
The obvious way would be another COM method that sets a bool which is checked before I process each file.
I once made an anti-virus scanner that ran as an ActiveX control in IE and I used precisely this method, and it worked fine. The control was free-threaded, so the StartScan() method (which was called by script in an HTML page) created a new thread to do the actual scanning. This let the main thread return to IE.
Now when the user clicked the cancel button, it called StopScan() which set a flag. The scanning code checked that flag and stopped when it was true.
So the key is to do your processing in a worker thread, that way your Stop() call will happen on another thread and your worker thread will see the change right away.
(I should note that this one project, done almost 2 years ago, was my only venture into production-level multithreaded COM stuff, so there might be a better way to do this. However, what I described above worked perfectly for me.)
--Mike--
http://home.inreach.com/mdunn/
your with and
|
|
|
|
|
Is it possible to change screen resolution or window resolution without interacting with drivers. Since gdi can provide us with only defined set of resolutions such as 800x600 or 1024x768. I need to change the resolution whatever i wish,it may be 5023x4045 or 7048x5678 or anything.
1) Is there any device driver do support this?
In vb, we can get all the controls of the form and change their width and height to make a form resolution changed.
2) Is it possible to do the same with windows?
|
|
|
|
|
MoveWindow or SetWindowPos will move a window or control. If you want to set the screen resolution, I know you can under DX, but even then you query DX for a list of resolutions the driver will support. Why do you want to change the resolution to something non-standard and ( assuming your examples are an indication ) something most monitors will not display ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|