|
How do I create a groupbox dynamically?
|
|
|
|
|
If you are using MFC, try:
CButton::Create("", BS_GROUPBOX, ...);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
If you are using MFC, try:
CButton::Create("", BS_GROUPBOX, ...);
Worked great! Thanks!
|
|
|
|
|
When opening a file in C++ for input, is there a way to grab the 'file last modified' field?
|
|
|
|
|
Take a look at _fstat , or for an MFC version, use CFile::GetStatus
|
|
|
|
|
I created a metafile that creates a bitmap file and saves it to disk. A regular program like MSPaint has no problem opening the file. However, when i try to display the bitmap i created in my own program, it simply won't display it. I have (with an amount of certainty) determined that this is due to the fact that the metafile does not actually save it in bitmap format. It also saves it with a transparent background even though I call SetBkMode and SetBkColor functions. I hope this makes sense.
Thank You
|
|
|
|
|
bkphat wrote:
I have (with an amount of certainty) determined that this is due to the fact that the metafile does not actually save it in bitmap format.
What format is it saving it in then ? If MSPaint can read it, it must be a bitmap, gif or jpg, mustn't it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thats the funny part. i can save it with any extension and it will still open in MSPAINT.
|
|
|
|
|
The file extension is irrelevant, MSPaint works it out by looking at the file. SO... what are you saving it as ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hallo,
Last time my query is not clear. first of all thanx to alexander and john r shaw
This is the program in c to communicate with multimeter thro gpib card.
In visual c++6, i made a console application and it communicates ..
then i did the same thing in mfc with some buttons to do action it doesnt communicate .. there is no error in the program but it doesnt work...
Please help me in this regard...
#include <sicl.h>
#include <stdio.h>
main()
{
INST dvm;
double res;
double list[2] = {1,0.001};
/* Log message and terminate on error */
ionerror (I_ERROR_EXIT);
/* Open the multimeter session */
dvm = iopen (“gpib0,16”);
itimeout (dvm, 10000);
/*Initialize dvm*/
iprintf (dvm, “*RST\n”);
/*Set up multimeter and send comma-separated
list*/
iprintf (dvm, “CALC:DBM:REF 50\n”);
iprintf (dvm, “MEAS:VOLT:AC? %,2lf\n”, list);
/* Read the results */
iscanf (dvm,”%lf”,&res);
/* Print the results */
printf (“Result is %f\n”,res);
/* Close the multimeter session */
iclose (dvm);
return 0;
}
thanx in advance
kingsly.
|
|
|
|
|
So what's the problem? I see no error-checking so how do you know which function calls are successful and which ones are not?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
first of all , Thank you so much David crow.
There is no error in compilation but there is no communication at all(mfc) ..but it works in console application..
The library has some commands like iprintf,iscanf...is there we need any change in command or we need to do something...
because i can see the commmunication only, when i send a value to the amplifier or i recieve or the print the result..
how to do it in mfc..
..
thnx in advance..
mfg,
kingsly
|
|
|
|
|
From the code snippet you've shown, I see no benefit in using MFC. It's not going to do anything for you. When you create a console application that supports MFC, the main reason for doing so is to take advantage of one or more of the non-GUI classes that MFC provides. I just don't see that with what you have provided. Please correct me if I've errored.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am creating an user interface, in that i will set & recieve the value to the amplifier..My main aim is to do in mfc ...thats why i dont how to make it work the same program in mfc..
thanx david for taking time in this...
waiting for the reply,
mfg,
kingsly.
|
|
|
|
|
I/O to a console window is done using cin/cout if using C++, or scanf/printf if using C. MFC does not provide anything useful for this, unless you are creating a GUI application.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
so we cant do this project in mfc .. or we have to do piping(console to mfc)
ur suggestion...
mfg,
kingsly
|
|
|
|
|
Assariah kingsly wrote:
so we cant do this project in mfc
Of course you can, but there's nothing in the code snippet you've shown that would benefit from it. A lot of the classes offered by MFC are GUI-related. There are a some, however, that aren't. For example:
CString
CFile
CDatabase
CCriticalSection
CSocket
CTime
CList See here.
Have you tried using MFC's AppWizard to create a dialog-based application?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
can you tell the way search engines find certain file types over the net
I wasn't able to find .mdb files over the net or database files in general. Can you help me with this issue or tell me a good search engine ?
gabby
|
|
|
|
|
Unless a page actually references the .mdb file by name, a search engine won't find it.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am using :
#import "msxml4.dll"
using namespace MSXML2;
in my project. I want to create an XML file and read data from a separate XML file.
MSXML2::IXMLDOMDocumentPtr pIXMLDOMDocument;
MSXML2::IXMLDOMProcessingInstruction *pIXMLDOMProcessing =NULL;
MSXML2::IXMLDOMNode *pNode;
I am getting a compiler error 2660 MSXML2::IXMLDOMNode::appendChild does not take 2 arguments.
I believe that there is something wrong with the namespace that i am using..
Can anyone provide any assistance? I am on a windows 2000 system with msxml 4 sdk
Below is how i use the functions:
pIXMLDOMDocument->createProcessingInstruction("xml", "version=""1.0""", &pIXMLDOMProcessing);
pIXMLDOMDocument->appendChild(pIXMLDOMProcessing,&pNode);
I got this example straight from the SDK. Not sure why it won't build.
Thanks
|
|
|
|
|
LCI wrote:
createProcessingInstruction("xml", "version=""1.0""", &pIXMLDOMProcessing);
Your quote-escaping is wrong, use \" not ""
createProcessingInstruction("xml", "version=<font color=blue>\"</font>1.0<font color=blue>\"</font>", &pIXMLDOMProcessing);
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Thanks for that... my error there..
But that still does not stop the compiler from saying that that function does not accept 3 arguments... Somehow, that function is has a different declaration and maybe it has something to do with the namespace. Do you know anything about that?
|
|
|
|
|
The example is using an older version. The prototype is:
IXMLDOMProcessingInstructionPtr createProcessingInstruction
(
_bstr_t target,
_bstr_t data
);
|
|
|
|
|
Hmm.
That seems to have done it. Where can i find documentation on the version that i am using because i have similiar issues with other functions, like appendChild and createElement
I call :
hr = pIXMLDOMDocument->appendChild(pIXMLDOMProcessing,&pNode);
and the compiler complains about appendChild does not take 2 args
and
hr=pIXMLDOMDocument->createElement(BSTR(L"Form"), &pIXMLDOMElement);
and the compiler complains about createElement does not take 2 args
Thanks for any input.
|
|
|
|
|
If you compile your code using an import statement, a file called msxml4.tlh will be generated from the typelib in the debug or release folder. You can see the prototypes in that file.
You can also open the msxml4.dll file in the Visual Studio Object Browser, which makes browsing the defs and prototypes a bit easier.
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|