|
It depends on what DirectX graphics module you are using.
Are you using Direct3D? Then, the interface ID3DX has several functions to load BMP, PNG, and JPG (but not GIF) as 3D textures. These textures can then be rendered in a 2D mode by using D3DXSprite. (If you do search engine requests on these terms, you could probably use the bulk of other people's code to try it out.)
If you're using DirectDraw, then you're on your own in terms of finding functions to decompress graphics files. I suggest looking into the FreeImage library. (Go to www.6ixsoft.com for more info.)
|
|
|
|
|
I've written a dll with ATL.I want to use it in Delphi.Is that possible?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Sure. Just make sure to export your functions with _stdcall
This is the way how I did it
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Gregor S. wrote:
_stdcall
You mean use it in definition of function and property or..?Can you give me example?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
This is how your exported functions in the DLL look like:
extern "C" __declspec(dllexport) void _stdcall YourFunction()
{
}
To make importing from Delphi easier it is recommended to change the function declaration in your .def-file like this:
; yourdll.def
LIBRARY "yourdll.dll"
EXPORTS
YourFunction=_YourFunction@0
This way you can simply import your function on delphi side by importing the function "YourFunction"
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks.Just another question.What about properties?Should I do anything for them too?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Well,I use this in cpp file:
extern "C" __declspec(dllexport) STDMETHODIMP _stdcall CSecurity::IsAdmin(BOOL* bAdmin)
But I got this error:
error C2375: 'CSecurity::IsAdmin' : redefinition; different linkage
I think I have to change some project setting?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hi. I've been working on these examples even after I unfortunately lost, my CD with source code provided with Petzold's book "Programming Windows" (version about 98 and NT). But now I'm stuck, and I desperately need the source code, to compare it with mine.
So, does anyone know where can I download it (for this version of book, not for Windows 1.0 or Windows 95), or if can someone send me only the source code (without executables), or even only, source code for 21th chapter.
Thanks.
|
|
|
|
|
http://jztele.com/~coldice/program/win-prog-src.tgz
|
|
|
|
|
Thanks for effort, but this is not what I need (since this is not what I need, and I noticed Jeffrey Ritchie in the commnet, I assume that this is not even from the book, which rource code I need).
Again, Im desperatly need this source code, can anyone help me with this??
|
|
|
|
|
THe dictionary doesnt give a technical definition, and its not clear to me what a token is from MSDN, in strtok . Say I have a string
abc_defg_hi, and I want to break it up into abc, defg, hi etc. THe delimiter is '_', and if do strtok on this string one time, what do I get back?
Sorry if this sounds too simple, but I am really not sure what exactly the token is, in this case.
Thanks,
ns
|
|
|
|
|
ns wrote:
THe delimiter is '_', and if do strtok on this string one time, what do I get back?
pointer to "abc" first time, pointer to "defg" next time, then pointer to "hi" and NULL the last time.
Token is a part of the string delimitted by the delimitter in this context.
Pavel
Sonork 100.15206
|
|
|
|
|
That explains it clearly. Appreciate it. BTW have you any light to shed on my postmessage/sendmessage problem (an earlier thread from yesterday? Its puzzling me tremendously.)
Thanks,
ns
|
|
|
|
|
Sorry, My first reply eas incorrect, was fixed
Pavel
Sonork 100.15206
|
|
|
|
|
I cant find the value of WM_COMMAND anywhere. WHat is it and where is it defined?
Thanks,
ns
|
|
|
|
|
0x0111. It's defined in WINUSER.H.
Pavel
Sonork 100.15206
|
|
|
|
|
I searched the MFC directory for files with text WM_COMMAND , and winuser.h never came up. I guess it doesnt exist in the MFC directory.
Thanks,
ns
|
|
|
|
|
I've created ActiveX Document Server and i want to insert my documents to Word documents. So i need to make my toolbar on MS Word to insert my object or to do something else with Word document similar to Adobe PDF toolbar. How can i do this?
|
|
|
|
|
I wonder what is an elegant way to do this? I just need to split everything that's after an optional \r (no matter if there is more text behind it). Thanks!
|
|
|
|
|
<br />
CString string, result;<br />
char* temp;<br />
char* token;<br />
strcpy(temp, string);<br />
token = strtok(temp, "\r");<br />
result = token;<br />
Probably not the most elegant way to do it but it works. Later.
Brad Jennings
|
|
|
|
|
string.TrimRight("\r\n");
|
|
|
|
|
Well. You will have to walk through the CString object and split the sections. Use the Find() and Mid() function for the CString object.
Kuphryn
|
|
|
|
|
isn't Trimright more efficient?
|
|
|
|
|
The Trim() functions are useful, however, they will remove all the ends off. Thus using TrimRight() will work for for the first occurance of "/r/n," but then you will lose all texts after it.
Kuphryn
|
|
|
|
|
exactly what was asked for. also TrimRight will not need to run a copy ctor, it changes length of the CString IMHO.
|
|
|
|