|
CDC::GetDeviceCaps
-c
Cheap oil. It's worth it!
|
|
|
|
|
Is there anybody who can give me code or tell me that "how can I get in array, the color values of a .bmp file after opening it(how to open for this purpose) with providing required x, y places to get specific image area in array "
I'll really be so thankful to you for your favour.
Thanks
|
|
|
|
|
Here at CP you can find Davide Pizzolato's CXImage, which does what you want (and a lot more.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
how to use combo box ?
i have one combo box on my dialog.
i write tray1 (ctrl enter) tray2 ....etc. in combo box, properties, data tab.
then i run the program. when i click on the arrow down key on combo box.. either one of whatever i typed in for data are there. it's empty. but if i click on somewhere of that empty box, the data is there. i just don't see it..
what did i do wrong so that data are invisible but there in the combo box.
|
|
|
|
|
go to the dialog editor, open the dialog with the combo box.
click the arrow on the combo and then drag the bottom of the rectangle down.
Cheap oil. It's worth it!
|
|
|
|
|
Hi all, I'm using DirectX and am trying to see whether my graphics card can use the IID_IDirect3DTnLHalDevice ref before committing my application to it (where a nasty fail would happen if it couldn't). I have used the EnumDevices Callback function to obtain a D3DEVICEDESC7 pointer and am trying to check the dwDevCaps variable for the D3DDEVCAPS_HWTRANSFORMANDLIGHT cap by using:
if (!(lpdEnumDevice->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT))
return Error;
lpdEnumDevice is the correct structure, but this test always returns false! I have tried using the IID_IDirect3DTnLHalDevice id at CreateDevice time and it works! so I know it must support it. What am I doing wrong? I have a nVidia GeForce 2 Ultra (Gainward spec) graphics card. Any ideas, views or suggestions would be very appreciated.
Ta all,
Alan.
|
|
|
|
|
Isn't this flag only useable for D3DDEVICEDESC_V1 ?
|
|
|
|
|
I developed a program as a Win 32 application (non-MFC)
But I found it very difficult to work with string but without CString (MFC). Ex: I can't find a function to cut string from 1 to m (Left()) , a function to cut string from n to m (Mid())...
Can I use this MFC class in my program without rewriting in MFC.
Can I include this MFC class (.h, .cpp) like a normal class ?
Help me !!!
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
In Settings/General choose "Use MFC in a static library"
rechi
|
|
|
|
|
And...
In stdafx.h replace #include <windows.h> with #include <afx.h>
rechi
|
|
|
|
|
I'd suggest you consider it twice and try to stick with std::string s. As for the functions you need, it's simple to write them:
std::string mid(const std::string& str,std::string::size_type n,std::string::size_type m)
{
std::string::size_type count=m<=str.size()?m-n:std::string::npos;
return str.substr(n,count);
}
std::string left(const std::string& str,std::string::size_type n)
{
std::string::size_type count=n<=str.size()?n:str.size();
return str.substr(0,count);
}
std::string right(const std::string& str,std::string::size_type n)
{
std::string::size_type count=n<=str.size()?n:str.size();
return str.substr(str.size()-count,count);
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Is it about the large amount of resources MFC is using?
rechi
|
|
|
|
|
The resource issue is one reason. The most important objection, though, is of a more profound nature. Adhering to a huge framework for the sake of a tiny utility class like CString can cause more harm than good: if you for instance need to port your app to a non-Win32 platform, you'll be regretting you're locked into MFC for such a minute reason. My advice is one should use MFC for what is worth --doing GUI stuff for Windows.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
that...and the fact that the original poster said "non-MFC".
-c
Cheap oil. It's worth it!
|
|
|
|
|
Instead of adding MFC, use std::string. It has a substr method which does what you're looking for.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
If you don't want to use std::string, use WTL which has a CString that works just like MFC's.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I developed a program as a Win 32 application (non-MFC)
But I find it very difficult to work with string without CString (MFC).
Can I use this MFC class in my program without rewriting my program ?
Can I include this MFC class like a normal class ?
Help me !
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
dlhson wrote:
Can I use this MFC class in my program without rewriting my program ?
no. but there are many classes available on this very site that do just about everything CString can do. or, you could use std::string.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Yes you can, you just need to include MFC support. Look up this topic in MSDN.
Add MFC Support to an ATL Project
Adding MFC support to a Win32 app is similar.
|
|
|
|
|
I created a template and want to use new to instantiate it. What is the correct format?
new CClass<float,double> m_Class;
Is this correct?
How would I use delete to clean up?
Thanks in advance.
|
|
|
|
|
CClass m_Class;
It is a template you said? If for instance:
template<class T>
class CClass {
};
You'll have to create it this way:
CClass<sometype> m_Class;
Where sometype is the template type you want to instantiate.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Yeah, and if u would like to instantiate on the heap, all u have to do is declare a pointer,
CClass <sometype> * m_pClass;
then call new:
m_pClass = new CClass<sometype>;
and whenver u need to free the memory u can call:
delete m_pClass;
and that's it!
Papa
Murex Co.
|
|
|
|
|
I try :
IXMLDOMDocument *p=NULL;
if (FAILED(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument2, (void**)&p)))
AfxMessageBox("failed");
else
p->Release();
It seems that the class is not registered. I've recently reinstalled the system. Is it a way to register all the usual classes in a shot?
rechi
|
|
|
|
|
How can you tell that the class is not registered? You don't fetch the return value from CoCreateInstance .
Did you call CoInitialize(NULL) ? That may be your problem.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I've fetched it in some other code. Anyway, the application is a MFC supporting automation so i don't need to call CoInitialize .
rechi
|
|
|
|