|
hansipet wrote: It is impossible to make dlls, which have parts in c++ und .net. (problems exporting the classes and so on...).
I don't know what that means but I have not had a problem creating the following:
(1)
C++/CLI DLL (mixed mode) that exports native C++ classes that are consumed by a native C++ application. Exported native classes use managed code to perform some work and then marshal results back to native memory consumed at the native application layer.
(2)
C++/CLI (mixed mode) assembly that publishes public managed classes that are consumed by .NET managed applications. Managed classes that use mixed mode to perform operations by using Native C++ classes and marshal the native results to managed memory for return to the managed application layer.
If you are trying to do anything else I would need an explanation to understand what that is.
led mike
|
|
|
|
|
I think it's important that if a method throws an exception, the object from which the exception is thrown is left in a consistent state, that is its invariants are left intact.
This can be challenging, though. Consider a method that sets a value:
public void SetValue(int value)
{
this.value = value;
}
My current approach to this is to postpone updating an object's values until an operation has completed successfully. This means possibly caching temp values as you perform a series of operations, each of which may throw an exception. Once everything has completed, we can update the object's values. So instead of the above with the assignment to 'value' taking place at the beginning method, we move it down to the bottom.
Thoughts?
|
|
|
|
|
Greetings!
I noticed this discussion board area was largely focused on design patterns, however; I am hoping that someone can help me with this project I am currently working on.
Essentially what I need to accomplish is to create an application for X Windows (Gnome) that will act like a Netzero banner. It will have advertisements on it and ideally when other applications are maximized they will not occupy space under this window.
Essentially this window will be about 100 pixels high and will span the entire width of the screen. Presently, I can accomplish every aspect of this application except for making the window non-overlapping. Please note that this is not the meaning that non-overlapping generally refers to but what the phrase itself describes is what I'm trying to accomplish.
Any help would be greatly appreciated! If anyone knows an open-source application that accomplishes this I will happily take a peak at it's source code! Worst case scenario I'll look at the gnome source code to see how the gnome panel operates. Essentially, this will have to act like another start menu/gnome panel.
Thanks!
|
|
|
|
|
CP is dedicated to devlopment on the Windows platforms, using Microsoft Visual Studio Tools. Perhaps if you asked this on a Linux centric site[^], you'd actually get an answer.
|
|
|
|
|
There are several businesses, what should I do first.
Please instruct in detail steps.
Help Software Business System Analysis
computer 3 PIII 733, 600, 500. Celeron 1000
Disk drives several 6G disks, 4G, 2G, etc.
Display adapters 1 2 integrated
DVD/CD-ROM drives 2 1 rewritable
Floppy disk drives 3
Keyboards 3
Mice and other pointing devices 2 usb 3 ps/2
Monitors 1
Network Adapters 4
Sound card 1 3 integrated
microphone 1
speaker 1
Handwriting pad 1
usb drive 1
restore card 1
PCTV card 1
(5 port) Switch 1
ADSL
resume management
partner management
document process
business decision
analysis
trade company
supplier database
group mail
System planning
Target, Strategy
System analysis
Requirement analysis
Functoin requirement
Performance requirement
Resources and environment requirement
Reliability requirement
Security requirement
User interface requirement
Cost and development progress requirement
Estimate entendibility requirement
Solution
EDI
Electronic payment
Web purchase payment
ERP
SCM
CRM
DSS
OA
DEM
IRP
Web Marketing
Logistic System
etc.
Please suggest
Please suggest what I should do first.
There are several businesses, what should I do first.
Please instruct in detail steps.
Lucky Green
|
|
|
|
|
Do? Do what? You listed a bunch of hardware and buzz words. Nowhere do you say what the end goal is. So, if figuring out what the requirements are eludes you, you've got no hope of ever making any progress on whatever this project is.
|
|
|
|
|
Well said.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?
|
|
|
|
|
This is really just a contraction of the Factory patterns. Basically, we have Concrete and Abstract Factory patterns.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes, of course there is factory pattern.
It's something like this:
==
==
=
__
||
||
/|/|/|/ |/|
| [] [] |
| |
Slow day at work, eh.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
flyingxu wrote: Is there really a pattern named 'Factory', or it's just something in Java?
Yup, software patterns are language independent.. see it as a concept with a name, it makes commucation between developers easier (once they know the meaning of a pattern).
Here one example of use for a factory in C++: A plugin (in form of a shared library) has typically one static function in a DLL that creates and returns a new plugin instance/object to the caller.
Hope it helps.
|
|
|
|
|
Yes you can create a class which can provide you the desired objects.
such class can be a Factory.
Stack *pStack = CFactory::GetStack(n);
where n -> type of stack.
Sameer();
|
|
|
|
|
hello friends
i don't think this is the right forum ...
but i'm going to design the application ...
i need buttons to put in the toolbar and on buttons to give a fine look for the presentation of my application .
can anybody helps me ???
thanks
|
|
|
|
|
|
|
|
|
Hello guys and girls,
I've got a generic architecture best principals question for you I as hoping people could give me some pointers on (or at least, generate some discussion over). The issue I've just encountered is as follows:
I'm generating a plugin for a service. My plugin will be compiled as a stand alone dll and called from an application.
There are two stages of execution for the plugin: 1. Set up as part of a winforms application, then 2) execution as part of a windows service.
In generating the setup information I specify a list of types of "Email Processor" class to use, where EmailProcessor is an abstract class and each type of email processor extends that abstract class to create in instance class.
In saving the settings, the list of EmailProcessors was to be saved using XmlSerialisation (this is functionality of the parent application and not my plugin), which throws an error since the type of the EmailProcessor is dynamic. I can't implement any sort of custom XmlSerialisation so I have had to make the abstract EmailProcessor class into a real (non-abstract) class and then throw a NotImplementedException from each of its methods.
This has obviously broken the basic inheritance model slightly - not so much as to be truly irritating but enough to make me think there was probably a more correct way of approaching the issue.
Can anyone suggest to me what I should have done to allow EmailProcessors to maintain their inheritance model but overcome the issues I had with getting round the XmlSerialisation of dynamic types that I had no control over?
Any thoughts greatly appreciated.
Cheers,
Adam
|
|
|
|
|
|
Hi Joseph,
Thanks very much for the response, but unfortunately (as was mentioned in my original request but perhaps could have been made clearer) the plugin architecture is already in place as part of an application that is already live on a number of systems. The only reason for mentioning the plugin architecture is actually to define the constraint the my settings must be stored using XmlSerialisation, which is what causes my problem in implementing a proper inheritance model.
Thanks for your help, I appreciate you taking the time to respond.
|
|
|
|
|
I might not get your complete plugin design... however I'll try an answer.
How about a plugin impements an interface (e.g. pure abstract class in C++), one method could be OnSerialise(HFILE hFile) . Whenever the application needs to serialise data it will find the corresponding plugin and request it to serialise its data by calling pPlugin->OnSerialise(). The file handle is just an example in case you want that multiple plugins write into the same file.
Here an example plugin interface, the first two methods are generic:
class IPluginInterface
{
public:
virtual int GetVersionNumber() const = 0;
virtual void DeleteThis() const = 0;
virtual bool OnSerialise(HFILE hFile) = 0;
virtual bool OnDoStuff(int nEvent) = 0;
};
|
|
|
|
|
I did consider the use of interfaces to get round the problem, but unfortunately XmlSerialisation will still stumble on the main issue that I'm trying to store a list of EmailProcessors that would all have different types.
The only way I came upon to get round this was to cast down to an actual instance of the parent type to store my setting and use a string within the parent type to allow me to cast back up to the appropriate child type after serialisation once the plugin is running.
Is there a more correct solution or is this the only way round the dynamic typing issue caused by an XmlSerialisation process that I can't modify?
Thanks very much for taking the time to respond - it is appreciated.
Cheers,
Adam
|
|
|
|
|
NamelessParanoia wrote: main issue that I'm trying to store a list of EmailProcessors that would all have different types.
I think the solution could be using polymorphism in your design. I understand from your description that your serialiser needs to get the appropriate data from each EmailProcessor (each processor could be internally handle a different type). In C++ language I would suggest to derive EmailProcessor from an interface that has a pure virtual method such as virtual void GetEmailData(buffer) = 0 , in different EmailProcessors you would specialise this method differently. Now, the serialiser can collect data from any EmailProcessor in (step one), then convert the collected data into a valid XML tree (step two).
Hope it helps,
Mark
|
|
|
|
|
Hello,
Can anyone gimme some pointers, links, Ideas, ways, thoughts about
(a) Deriving from a Singleton Instance Class.
(b) Having a Distributed Singleton instance Class across machines and processes where by we can instantiate a class on one and only one machine / process?
Thanks and regards,
-Chetan Kudalkar
Chetan Kudalkar
|
|
|
|
|
hi everyone,
I'm making an accounting software for an organization for the first time and I've designed a ledger table as Ledger(ID, TDate, Debit, Credit, Balance)
The balance field is a calculated field. And I was wondering how should I program its update and delete triggers. Can u plz give me a few useful tips on this.
thanks
Rocky
|
|
|
|