|
There is no such thing as a window in C++. Instead, each platform has it's own windowing library. You can move away from MFC and use Win32, which is a lot more work. You could also try TCM/TK ( I think that's what it's called ) or some other cross platform windowing library.
Have you seen the NeHe site ? He has OpenGL samples in just about every possible configuration, for most platforms.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
If you use Dev-C++, you might want to check out the AllegroGL[^] devpak. It adds OpenGL routines to the Allegro game/graphics framework.
Alternatively, you could download the SDL[^] devpak. It has some very simple bindings to OpenGL that ease the creation of windows in which to use OpenGL.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
|
Hi,
How can I register my application in a way that once someone right click on any file in the windows explorer he will see an entry in the popup menu to run my program on this file.
For example, if you install WinZip and right click on any file, the popup menu will show you you can run WinZip for this file.
thanks in advance,
Shay
|
|
|
|
|
|
Does anyone have a suggestion on where to look to explain why a dialog ends up modeless when it is invokes by actually calling DoModal. This is the first time this has ever happened to me. It uses a layout manager from this site, but other dialogs in the same project that are called in the same way remain modal. Only this one seems to change.
Happy programming!!
|
|
|
|
|
|
I have created a Deployment Program to set up a VS.net GUI application on a users machine. I think I need to perform a custom action to register an Active X Control on the users system as part of the Deployment Project. Basically an OCX is loaded on the users machine and registered.
To register I need to perform:
regsvr32 name.ocx. Does anyone know how to register an OCX as part of a deployment and setup program?
Jerry
|
|
|
|
|
Just add the OCX file to the Application folder, like any other file. That's it.
Pls let me know your status.
Sarvan AL
|
|
|
|
|
Does anybody have sample of converting text file to xml?
Thank you.
sun
|
|
|
|
|
Is your text file xml formatted or no?
|
|
|
|
|
if he wants to convert it to xml, I would assume it's not "xml formatted" ( whatever that means ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
there are usually no "pre-defined" ways to do this ( as far as i know ), it always depend on the input.
You need to parse the text file and extract what will be tags ( do you have something like that in your file ? ) and what will be the data.
How is your text file formatted ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
acutally it is PLC code
<br />
FUNCTION_BLOCK SR_IL (* SR flipflop in instruction *)<br />
VAR_INPUT<br />
S1 : BOOL; (* dominant set-input *)<br />
R : BOOL; (* none dominant reset-input *)<br />
END_VAR<br />
VAR_OUTPUT<br />
Q1 : BOOL; (* output *)<br />
END_VAR<br />
<br />
LD S1<br />
OR R<br />
RETCN (* return if both FALSE *)<br />
(* and do not assign a value to Q1 *)<br />
<br />
LD S1 (* no need to use R *)<br />
ST Q1<br />
<br />
END_FUNCTION_BLOCK<br />
I'm trying to convert it to xml format, I just need any text to xml conversion sample for general idea.
Thank you.
sun
|
|
|
|
|
If the file was XML based XSLT would be the answer. Since your file is not XML based you'll have to write your own parser (or find someone elses). If I was doing it I would use Spirit (from Boost) to do the parsing - especially if you have access to the BNF of the source format. Good luck.
Steve
|
|
|
|
|
HI ,
You can open any xml file in the text mode see the tag representation and then open your file in append mode and move in and place those tag there ,only the header needs to be fixed all the other tag can be any format(of your name) ,this is the raw way of converting it into xml format.
For example to add the header i will do something like this :-
<code>int CXmlWrite::AddHeader(CString& sHeader )
{
CString sAddHeader,sAddHeader1;
m_sHeader = sHeader;//store it needed for closing
sAddHeader.Format("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
m_fXmlWrite<<sAddHeader<<endl;
sAddHeader1.Format ("<%s>",sHeader);
m_fXmlWrite<<sAddHeader1<<endl;
return 1; // the count of numbers addedas header
}</code>
// this you need to place above between the inverted commas
//"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"
Hope it solves your problem
Regards
FarPointer.
-- modified at 10:16 Thursday 12th January, 2006
|
|
|
|
|
Thank you all for responding my query.
I'm working on it if I find any trouble I will contact you guys again.
sun
|
|
|
|
|
I need to dynamically retrieve ODBC parameters through code in Borland C++. Anyone any idea?
Many thanks
|
|
|
|
|
Priya..k wrote: ODBC parameters
What exact ODBC parameters? Can you please be more specific?
Koushik Biswas
|
|
|
|
|
I have to retrieve the username and password from the ODBC connection and use it in my program which has been developed using Borland C++ version 6. I am using a DataModule in my program where i set the DSN name and the username and password. But now i want to dynamically retrieve the username and the password from the odbc connection. Hence the program will be able to execute for any DSN on any machine.
Regards,
Priya
|
|
|
|
|
Aha! So you are trying to retrieve username and password for one or more DSN-s programmatically. I do not know your purpose, but providing you with a way of doing that is like providing a mechanism by which anybody can hack into a database and wreck havoc with privacy! How can you expect that the password will just be stored somwhere where you can go and pick it up from? If it is easy like that, it beats the purpose of a "password" doesn't it?
Now here is what you can do: DSN entries are all stored in the registry under either HKCU\ Software\ ODBC\ ODBC.INI or HKLM\ Software\ ODBC\ ODBC.INI (depending on whether they're User or System DSNs). You just have to read the correct registry key (key name = DSN Name). If you run regedit and drill down to that location, you will see all your DSN-s listed. For any DSN, the values listed are all or some of these:
Database, Driver, LastUser, Server, Trusted_Connection...
But Password is not stored in the registry. You cannot get the password. As I told you, Microsoft won't be in business long if they provided you a way of getting to that! I am sure the password is stored somewhere encrypted - even if you knew the location, you probably have to retrieve the encryption key to decrypt it. And on top of that, your executable would probably need to set administrative privileges for itself to do any of that.
Koushik Biswas
|
|
|
|
|
Hi
Tools like CPU-Z detect the manufactor of the build-in RAM with Serial Presence Detect (SPD) device on the RAM. How does this work? I think I need a driver on NT-based systems.
Can anyone give me a thought-provoking impulse?
Thanks,
André
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
Have a stream of data that is not an IStream.
I am attempting to send this stream to GdiPlus api call "Image::FromStream(IStream*)" for display.
Is there a windows stream function that will do this(i.e. Make this conversion). I tried casting and that was unsuccessful.
|
|
|
|
|
Here is a program to show how this can be done:
#include "stdafx.h"
#include <objbase.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CoInitialize(NULL);
char YourData[] = "Your data here.";
HGLOBAL hGbl = GlobalAlloc(GMEM_MOVEABLE, sizeof(YourData));
if ( hGbl )
{
LPVOID pMem = GlobalLock(hGbl);
if ( pMem != NULL )
{
memcpy(pMem, YourData, sizeof(YourData));
GlobalUnlock(hGbl);
IStream* pStream;
HRESULT hr = CreateStreamOnHGlobal(hGbl, TRUE, &pStream);
if ( SUCCEEDED(hr) )
{
// Use stream here!
char TestBuffer[1024];
ULONG Read;
hr = pStream->Read(TestBuffer, sizeof(TestBuffer), &Read);
if ( SUCCEEDED(hr) )
{
MessageBox(NULL, TestBuffer, "From the stream", MB_OK);
}
pStream->Release();
}
else
{
GlobalFree(hGbl);
}
}
}
CoUninitialize();
return 0;
}
Steve
|
|
|
|