|
All my musing about possibilities was nothing for the short-term.
But with a (more or less) limited amount of work, you probably could form your code into a library.
The interface of that library needs to be a working c++ header file with all variables and private members.
Maybe that is OK with you.
If you think your contarctors would get too much information from seeing the variable types you defined, you need to go one step further.
Add an Interface-header, which declares a abstract base class.
You (or them) would then have to implement a "mockup-implementation" of this interface. This may be (probably is) a large amount of work.
That way, they could program against the interface, with only you putting the code together.
In the "cleaned" approach, as many private functions as possible are moved out of the class to an anonymous namespace at the top of the cpp-file.
As your contractors never get to see the content of the cpp-file, you are hiding this code from them.
Functions in an anonymous namespace are effectivly static members, and from my experience, an astounding amount of non-trivial static functions could be made static.
Failure is not an option - it's built right in.
|
|
|
|
|
Yup, i think that's the best solution here: to change my code into a library.
Although this only "hides" the code that doesn't deal with dialogs/resources, correct?
Thanks a lot.
|
|
|
|
|
You can have a lib that is opening dialogs.
But then the project using the lib has to include the libs rc-file:
In the Studio resource-view, right-click on the "PROJECTNAME.rc" and select "resource include" to enter the line
#include "lib-resource-file.h
in the upper and
#include "lib-resource-file.rc"
in the lower box.
Most often, the rc-files do not contain anything special.
Failure is not an option - it's built right in.
|
|
|
|
|
Cool, a perfect solution then. Thanks a lot.
|
|
|
|
|
|
Joe Smith IX wrote: Is there really a way to give them just the .h files without the .cpp, just like a .lib does?
Yes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Compile your code into a DLL and export the classes. They'll see the method prototypes, but won't see the code behind them. One thing to consider is that you MUST provided complete documentation for the classes so the programmers know how to use them properly.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am using SelectSinglenode in the following way and the code is always aborting:
IXMLDOMNodePtr pChild;
IXMLDOMElementPtr pParent=NULL;
IXMLDOMNode **resultnode=NULL;
HRESULT pChild = pParent->selectSingleNode(_T("rtcs//Connection::connect"),resultnode);
i think i am not able to give the right first parameter of selectsinglenode function.
Please point out where i am wrong
Regards
|
|
|
|
|
hmm im not sure but you could try
IXMLDOMNodePtr pChild;
IXMLDOMElementPtr pParent=NULL;
IXMLDOMNodePtr resultnode=NULL;
HRESULT pChild = pParent->selectSingleNode(L"//rtcs//Connection::connect"), &resultnode);
hope that helps
|
|
|
|
|
if pParent is NULL, how can you call pParent->selectSingleNode() ?!
this will end in tears !
|
|
|
|
|
actually it takes two parameters whenever i am giving one parameter it is giving error.
Regards
|
|
|
|
|
i was talking about the NULL pointer dereferencing matter...
|
|
|
|
|
The query should be /rt/Connection/@connect
And you need to initialize pParent before using -> on it
|
|
|
|
|
hi
any body aware how can i find whether my application is running on laptop ro desktop machine.
Please let me if any win api is available or any specific thing i can look up.
sonani prakash
|
|
|
|
|
Using WMI Article on CP there are a few others
the WMI class that might contain the data your after is
Win32_ComputerSystem
there might be another.
worth a look
|
|
|
|
|
Hi all,
i have the following xml file:
<?xml version="1.0"?>
<rt name="Remote ">
<Connection connect= "connectval" ipaddress = "ip_addresss" Port = "port_number"/>
</rt>
I want to get the value of variable connect and store it using selectsinglenode function.
how can i accomplish the above.
Regards
|
|
|
|
|
Maynka wrote: how can i accomplish the above
you already answered the question
Maynka wrote: using selectsinglenode
What exactly is the problem?
|
|
|
|
|
I am using SelectSinglenode in the following way and the code is always aborting:
IXMLDOMNodePtr pChild;
IXMLDOMNode **resultnode=NULL;
HRESULT pChild = pParent->selectSingleNode(_T("rtcs//Connection::connect"),resultnode);
i think i am not able to give the right first parameter of selectsinglenode function.
Regards
|
|
|
|
|
if pParent is a IXMLDOMNodePtr , then you have to do:
pChild = pParent->selectSingleNode(_T("rtcs//Connection::connect"));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Could that be:
"//Connection/@connect"
describing any <connection> tags having a "connect" attribute?
I am not an XPATH-Guru, though.
Failure is not an option - it's built right in.
|
|
|
|
|
In MFC SDI,How to write D3D code?
I had wroteen some code about D3D in MFC SDI project.
But I have a problem that when I resisze the view, the model will resize.
I had reccomputed the projective matrix by the view size (when I resize the View).
I had tried to modify the projective matrix and viewport.
But it seems to be error.
HRESULT hr;
hr=m_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255,0,0,0), 1.0f, 0);
m_ViewClientSize.cx=cx;
m_ViewClientSize.cy=cy;
D3DXMATRIX proj;
D3DXMatrixPerspectiveFovLH(
&proj,
D3DX_PI * 0.5f, // 90 - degree
(float)m_ViewClientSize.cx / (float)m_ViewClientSize.cy,
1.0f,
1000.0f);
if (m_pD3DDevice)
m_pD3DDevice->SetTransform(D3DTS_PROJECTION, &proj);
D3DVIEWPORT9 ViewPort;
m_pD3DDevice->GetViewport(&ViewPort);
ViewPort.Width=m_ViewClientSize.cx;
ViewPort.Height=m_ViewClientSize.cy;
if (m_pD3DDevice)
m_pD3DDevice->SetViewport(&ViewPort);
|
|
|
|
|
Hi,
how can i check, given a file name, if the file has been 'locked' by any process... either for reading, writing or both?
Thanks...
------------------------------------------------------------
Never wear anything that panics the cat.
|
|
|
|
|
Can you open the file exclusively?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Actually, I want to check whether a file is locked by *any process*, be it my own app or any other process...
I'm aware of file locking functions when we open a file ourselves... but what about the files that are locked by some other app..?
|
|
|
|
|
Abhijeet Pathak wrote: ...but what about the files that are locked by some other app..?
If a file is open by another process, and your process tried to open the file exclusively, it would fail.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|