|
unsigned int i = 0x11223344;
BYTE *pb = (BYTE *)&i;
TRACE("%d, %d, %d, %d", pb[0], pb[1], pb[2], pb[3]);
When history comes, it always takes you by surprise.
|
|
|
|
|
int x = 0xfc12a15d;
char c[4];
for (int y = 0; y < 4; ++y)
c[y] = (x & (0xff << (y * 8))) >> (y * 8);
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
Thanks for every one
contributed inthis context.
now my task is simple with your sugestions.
once again thanks to all.
anju
|
|
|
|
|
I have a dll ( a Palm conduit actually ) and I'd like to know the path to the dll from within the dll in dllmain. Does anyone know how this can be done ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Shame on me, the answer was in the FAQ...
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Just to clarify the FAQ (since it deals with an EXE, not a DLL), DllMain() is passed the HMODULE of the DLL. Pass that handle to GetModuleFileName() .
If you pass NULL to GetModuleFileName() , you'll get the path of the EXE that loaded your DLL, which isn't what you're looking for.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
i'm not really sure so don't quote me but i vaguely remember trying to do this years ago.
::GetModuleHandle
or maybe these which are in PSAPI
::EnumProcessModules
::GetModuleInformation
::GetModuleFileNameEx
|
|
|
|
|
Hi, all
How do you get the exact width and height (even if the user has increased or decreased the DPI settings) of a single-font multi-line text without drawing it? Do you use GetCharWidth32 for this process or are there better ways? Could you please demonstrate this process in code please =)
Aidman » over and out
|
|
|
|
|
CDC::GetTextExtent or DrawTextEx with the DT_CALCRECT flag
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Great thanks!
Aidman » over and out
|
|
|
|
|
I want to use some functions exported from a dll, but I don't have the documentation or the header file. I can get the names of the exported functions by using dumpbin, but how do I determine the function parameters?
|
|
|
|
|
Guess...
That's the only way
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
If the function name is mangled, you can demangle it using UNDNAME.EXE.
You should save yourself and your company years of grief by shooting yourself through the head immediately. Believe me, in the long run it'll turn out better for everyone. - Tyto (at arstechnica)
Awasu 1.0[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Thanks. Actually, it's a C dll, so the names aren't mangled. I wish the function names were mangled, then I could find out the parameters using the latest version of Depends.exe. Unfortunently, I think Anders is correct, I have to guess or get knee deep into the disassembled ASM. Thanks for your help.;)
|
|
|
|
|
Okay, I have the window, title, toolbar, and basic commands done... All that I have to do is create the editbox (or whatever its called) for the text to go into... How would I do this? I dont really know where to place thiscodde? And how would I go about creating the editbox? Ive never really used MFC in this area before.
Thanks,
orcblood
|
|
|
|
|
Well, the first thing would be: Are you using the visual tools in VisualStuio to create your application, or are you coding everything from scratch?
If you use the visual tool, it's simple drag&drop to create it, and then you assign a member variable for it.
If you create it from scratch it's a bit more work, but should not be too much.
I do not have the code at hand now, but it should be something like this:
CEdit editMyTextEditor;
editMyTextEditor.Create(...); //replace "..." with parameters
editMyTextEditor.MoveWindow(RECT); //Place the control within your window.
editMyTextEditor.ShowWindow();
As I said I am not sure if this is the correct sequence to create the control and showing it, but hopefully you can get something out of it. I will dig out some code for you tomorrow if you have not yet found something, but right now I am going to bed!
|
|
|
|
|
Okay, I don't know how to use Visual Tools . Is that for .net? I suppose I should say that I have MSVC++ 6.0 no thte .net version... Anyways, I would greatly appreciate you looking for some code I really don't know how to do it in MFC but I know how to do it in a standard C++ file - I just couldn't get the program looking the way I want... And after creating my MP3 player in MFC Ive decided that it would be easier/better to create the program in MFC.
Thanks,
orcblood
|
|
|
|
|
I will look for some code tomorrow.
But you also have the ability to make your application visually in VisualStudio 6.0. When you create a new application, you will have an option for what class your C...View class should be derived from. There you select CFrameView. If you use dialog based application, you don't have to select anything. Then on your resource Tab you will have all your visual parts, and you can modify them. Play around and see what you can find out...
See u tomorrow then.
|
|
|
|
|
Ahhh, ok, I am unable to go to bed before this is solved:P Well, here's the code. Three lines that's all that's needed:
CEdit m_editEditor;
m_editEditor.Create(ES_AUTOHSCROLL | ES_LEFT,CRect(50,50,150,70),this,NULL);
m_editEditor.ShowWindow(SW_NORMAL);
Voilà!
This creates the most basic single line control. You can change the CRect parameters to change the size, and you change the ES_ values to change the look and behaviour of the control. The last parameter is the controls ID, which I could not be bothered to make. but it's simply a
#define IDC_EDIT_MYEDIT 100
statement to create that..
Well, hope this sorted things out. NOW i have to sleep;)
Good luck with your programming.
-Jaran
|
|
|
|
|
Wow thanks for your help. I just have one problem about where to place this code - that is if its for coding straight into the program without using the class wiz... Where would I place this code about? Ive tried in some differenft spots and it doesn't really seem to be working too good .
orcblood
|
|
|
|
|
Well you should put it in your init or startup function, where you define controls, set the window size...
|
|
|
|
|
|
How would I get rid of the MFC logo?
orcblood
|
|
|
|
|
|
How do I print HTML documents programmically? I have tried
(32>= (int)ShellExecute(NULL,"print", m_textList[i],NULL, NULL, SW_SHOWNORMAL));
But it doesn't print all the documents that are in the array (for loop increasing i).
It doesn't print all of them just someof them.
-Steven
CPACodeProject Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|