|
CPallini wrote: If you need to write some simple XML then you can hand-craft it
To be honest, I'd always recommend using a writer, as it'll (hopefully) remember to do things like specifying the file's encoding, closing tags, quoting text etc. The quoting text bit, especially, is very easy to forget to do or, even if you remember it, easy to get wrong.
|
|
|
|
|
All do you need then is an XML validator tool. IMHO Writing hand-crafted XML has some educational purposes too.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for reply. I have looked for msxml for doing xml operation. I have my parser reader function I need to implement writer function or function to modify existing file. So if I had an xml document and I want to move to specific tag given its ID. Would I have to iterate through all the nodes until I found the tag with the id I wanted or is there a quicker way in msxml. I have read its sdk but fails to find anything regarding this.
Thanks
amit
amit
|
|
|
|
|
No, you haven't to. You may search for nodes, see for instance [^] or [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Whats the size of each pixel of a bitmap in memory?
|
|
|
|
|
I suppose it depends on color depth...
See BITMAP struct definition [^], the bmBitsPixel member looks promising.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I was thinking it depends on the resolution...
|
|
|
|
|
That was exactly what traveled my brain for a while.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Look up DIBs and BMP format. Technically the size of a pixel is something like "bmPlanes * bmBitsPerPixel", but I have never seen the number of planes set to anything other than 1.
You need to look up the format because that is not enough information to actually read a .bmp file; each row is aligned on a 4 byte boundry.
Why the planes where specified (I know) is up to you to figure out.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hello,
can somebosy help me...
Im creating a combobox in AddFrm.cpp - Oncreate method which is in toolbar control.
But i have one menu on click of which i want to disable that combobox in some other class.
Can Anybosy help me out
............
ASAp
Thanks
tina
|
|
|
|
|
There can be multiple ways of doing that. You could have a global variable which contains a pointer onto a CComboBox class, or have the handle of the combo stored that way, or you can make a member in the class that belongs to what you are placing the combo on behave the same way and make that member accessible from elsewhere, or or or, if you want more specific help, show us some code, like how you create the combo and where you want to enable/disable it...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Why don't you post the relevant code? It would be much easier for anyone who wants to answer that way.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I have a feature that requires an additional library to be linked to my project.
#define ENABLE_FEATURE
#ifdef ENABLE_FEATURE
void foo()
{
bar();
}
#pragma ???????? // some way to tell the linker to do that?
#endif
I have a *.LIB file and i want to link the project to it if ENABLE_FEATURE is defined, if it not, however, the library shouldn't be linked to reduce the exe size.
My question is: is there any way to link the project to the library without creating two separate project configurations? My project is developed with VC++ 6.0
Right now I have two project configurations, one linking with the library and one which doesn't, and I have to constantly switch between them, and if ENABLE_FEATURE doesn't match the correct configuration it will either fail to link or it will crash at runtime.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
modified on Wednesday, January 7, 2009 6:58 AM
|
|
|
|
|
sashoalm wrote: Right now I have two project configurations, one linking with the library and one which doesn't, and I have to constantly switch between them, and if ENABLE_FEATURE doesn't match the correct configuration it will either fail to link or it will crash at runtime.
ENABLE_FEATURE switch should be set as per configuration property.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi, CPallini,
Thanks for the answer!
The project has a little quirk however. The lib file is actually linking to dlls, and I use Inno Setup to create installations. Inno Setup has preprocessor with the same syntax, so I use a config.h header file that's included both in my Stdafx.h and in Setup.iss files.
I wan't when I disable the feature, the code that calls it to be omitted, the linker to remove the library, and the dlls to be omitted from the install.
And the project is already built around the idea that you have a config.h file that's included everywhere in the project (and in Setup.iss file), so changing that for one feature would be confusing, while changing it for all #defines and settings would be too much of a change.
Anyway, I found this a pragma that might work, and I'm testing it right now:
#pragma comment(lib, "mylib.lib")
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Try this:
#pragma comment(lib, "LibraryName.lib")
See here[^] for more information.
Steve
|
|
|
|
|
Thanks
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
It's slightly obscure, but you can use the following to tell the linker to add a lib file:
#ifdef MY_SHINY_FEATURE
#pragma comment(lib, "shinylib")
#endif // MY_SHINY_FEATURE
...
void DoSomethingMaybe ()
{
#ifdef MY_SHINY_FEATURE
shinyfunction ();
#endif // MY_SHINY_FEATURE
}
Iain.
|
|
|
|
|
Thanks!
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi Guys,
I have briefed on the current implementation of my application which is used to detect mobile data cards.
The application consists of an Main module and seperate dlls modules, one dll for each mobile data card that my application wants to detect.
This mobile data card dlls contain unique device info like the registry name/path that is used to uniquely identify an card from other cards hardcoded in them.
Assume 3 device dlls whose class goes by the name CMobileData_A and CMobileData_B. These class are derived from an base class CMobileData as indicated by the code snippet below.
class CMobileData
{
public:
bool DriverInstalled();
bool DevicePresent();
}
class CMobileData_A: public CMobileData
{
public:
bool DriverInstalled();
bool DevicePresent();
}
class CMobileData_B: public CMobileData
{
public:
bool DriverInstalled();
bool DevicePresent();
}
I have given 2 methods to illustrate the current implementation.
When application is started, the main module contains reads an xml file which contains the list of MobileData cards that it has to load(dll names of the different Mobile Data card dlls).
Each dll that is mentioned in the xml is dynamically loaded and it's instance created and the pointer to the instance stored in another list(say list m_DllsInstance) for all the dlls present in the xml.
Now the methods DriverInstalled() and DevicePresent() of all the dlls are called using their respective class instance using the list m_DllsInstance one after the other.
When the nth item in the m_DllsInstance list which refers to the CMobileData_A class instance, the 2 methods would be called. Only for this particular call will these 2 methods return success as
this is the currently used device. Hence my main application will contain the logic to figure out that this is the device in use there by detecting the card.
This application works fine.
But the problem here is that the current implementation will require a seperate dll for each mobile data card and this card will contain all the unique characteristices of the card.
I want the change the implementation such that there is a need for a single dll.
This dll inturn could refer to an external configurable file (say an xml file) which could contain info unique to each mobile data card.
The implementation should take these unqiue characteristics from the xml file and pass these info to these 2 methods.
The 2 methods instead of having the hardcoded unique device info, should recieve the requied info as a parameter.
Any guidance as to how i go about achieving this implementation will be of great help.
|
|
|
|
|
I am trying to create a toolbar in CView.The toolbar is getting created,but it is not visible.
Can anyone help me.
Thanks in advance
|
|
|
|
|
Hi guys!
*need 2 register an ocx programatically
any help's appreciated..
thank's in advance
|
|
|
|
|
Hey man!
Can you write with a bigger/brighter font?
I'm unable to see your request...
BTW:
- Load the component's
DLL (i.e. the .ocx file) - Call
DllRegisterServer [^]
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hi All
I am geting error when i am useing COleDataObject.I got some example code from net.It's very help full for me but when i am use the code then i am geting error.
COleDataObject odj1;
if( odj1.AttachClipboard() )
{
if( odj1.IsDataAvailable( CF_HDROP ) )
{
STGMEDIUM StgMed;
FORMATETC fmte = { CF_HDROP,
(DVTARGETDEVICE FAR *)NULL,
DVASPECT_CONTENT,
-1,
TYMED_HGLOBAL };
if( odj1.GetData( CF_HDROP, &StgMed, &fmte ) )
{
HDROP hDrop = (HDROP)StgMed.hGlobal;
UINT cFiles = ::DragQueryFile(hDrop, (UINT)-1, NULL, 0);
CString szText;
char szFile[MAX_PATH];
szText="";
for( UINT count = 0; count < cFiles; count++ )
{
::DragQueryFile(hDrop, count, szFile, sizeof(szFile));
szText += szFile;
szText += "\r\n";
}
m_pRich->ReplaceSel(szText);
if (StgMed.pUnkForRelease)
{
StgMed.pUnkForRelease->Release();
}
else
{
::GlobalFree(StgMed.hGlobal);
}
return;
}
}
}
error geting
error C2079: 'odj1' uses undefined class 'COleDataObject'
error C2228: left of '.AttachClipboard' must have class/struct/union
error C2228: left of '.IsDataAvailable' must have class/struct/union
error C2228: left of '.GetData' must have class/struct/union
Plz help me
|
|
|
|