|
How do i convert a "unsigned char[8]" 8 byte array to a long. Please help. Many thnx in advance.
|
|
|
|
|
|
thnx for the reply, but that's not exactly what i'm looking for. I solved it by using a union.
union x
{
unsigned char[8] ucaByteArray;
double d;
};
Because it's a union, they share the same address space, which means the content of all the 8 element can be accessed directly by the double. This is precisely what i want, and it works great.
|
|
|
|
|
hi all,
i want to show a web page in a dialog box..i dont know what control to be used and how it should be done...I will be thankful for all suggestions and pointers..Please help me...
thanks in advance..
Himanshu
|
|
|
|
|
|
Hi,
If you are using VS.NET you can use CDHtmlDialog class.
The CDHtmlDialog class is used to create dialog boxes that use HTML rather than dialog resources to implement their user interface. CDHtmlDialog can load the HTML to be displayed from either an HTML resource or a URL.
CDHtmlDialog can also do data exchange with HTML controls and handle events from HTML controls, such as button clicks.
|
|
|
|
|
Hallo,
how can I create an extra new Button, or more than one Button next to the minimize/maximize-Buttons on a SDI-Dialog Frame for Windows ?
I'am using Visual C++ 6.0 / 7.0
Has somebody a solution, or a good method to do this ?
Thanks.;P
|
|
|
|
|
I know I've seen articles which custom draw the title bar and add extra buttons. Have you searched the articles here at CP and at codeguru.com?
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Do a search for the custom caption classes written by David Lorde. That article should do what you need. I think its his only article on CP.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
i need to unzip zipped file programmatically.
i have an example, but it is too complex to be analyzed.
hope get an easy example.
thx
includeh10
|
|
|
|
|
hi all,
I am getting a very strange problem with my internationalization code.I have made a dialog based application,and i want to load all the resources according to the locale selected by the user from menu.So i have to load all the resources at run-time according from the locale specific dll.Everything like menus etc. are working well.The problem is coming in loading the dialog itself at runtime,i have specified that this is a dialog based application.So can i change the dialog at run -time,in this case,and/or can i load the dialog button at run-time from either exe or dll???????????
|
|
|
|
|
MSDN->contents->Books->Developing International Software for Windows 95 and Windows NT.
The newest release of this book is also available for purchase online.
There are also some tutorials on codeproject on internationalization.
I hope this helps.
Trust in the code Luke. Yea right!
|
|
|
|
|
Thanks to Rohit and John,
for their valuable help.
|
|
|
|
|
Take a look at CDialog::InitModalIndirect() and then go from there.
Regards,
Rohit Sinha
Do not wait for leaders; do it alone, person to person. - Mother Teresa
|
|
|
|
|
5-3 error LNK2019: unresolved external symbol "public: class ostream & __thiscall ostream::operator<<(char const *)" (??6ostream@@QAEAAV0@PBD@Z) referenced in function _main
5-3 error LNK2001: unresolved external symbol "class ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
5-3 fatal error LNK1120: 2 unresolved externals
I’m using vis studio.net
I’m in my second quarter of C++
I must have accidentally done something, because it worked before, but not it won’t even do the simplest of programs.
#include <iostream.h>
void main(void)
{
cout<<"Hello";
}
Is there a way to fix the library or reinstall what ever?
or, and better, is there a good book to use to do this by myself
Thanx
|
|
|
|
|
If you choose New Project and Win32 Project and run it.
Does it work then?
jhaga
|
|
|
|
|
It should be:
#include <iostream.h>
Hope this helps!
|
|
|
|
|
Hi
I want to have a control like the IP address control.
IP address control:
. . .
My control
- - - - -
I used a editbox and filled it like this oninitdialog().
I subclassed the CEdit to CMyEdit.
Only the first 2 characters may be typed in, then the cursor has to move to the next '-' + 1 char. further.
Any idea how to do this? and how can i get 'Backspace' to work properly? And how can i make sure when you type in the characters the ' ' is deleted. The ' ' isn't replaced by the character just typed in.
Greetings
Jens
|
|
|
|
|
Try using a masked edit ActiveX control. I've seen it on every system since Win95, so it shouldn't be a problem to use.
I haven't used it, so I can't help with it, but I know it's there and what it does (well, what it says it does, anyway )
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
You'll need to use a masked edit control. Examples on CP are plentiful.
JensB wrote:
I want to have a control like the IP address control.
Just curious but why re-invent the wheel?
|
|
|
|
|
Hi,
Now ,I have a problem.
I am programming the project need multi-COM ports.So far ,my useing programming computer is Laptop ,has one COM1 and one Modem COM2,and one Virtural Infrared COM port.But in Programming Project,I add a MSComm ActiveX controls assume it is COM5,Because there is no COM5(and there is no logic errors),so when the project compiling,the whole system is down,and blue screen,display the VxD errors,For solveing the problem ,I install a multi-COM port driver ,can add some virtual COM ports,See the attached pic(there is a link)
But I Compiled it again ,the system is down and blue screen display VxD errors!There is good solution?
|
|
|
|
|
Hi All,
I have a dilemma. I'm wrapping existing code that prints to stdout. I don't want those prints to show up on the screen, so I've redirected it using:
// redirect stdout to bit bucket
FILE* f = freopen("nul", "w", stdout);
I then created my own stream that prints to the console using:
// create a new stream to the console
fstream myStream;
myStream.open("CONOUT$");
Whatever I print using myStream shows up on the screen, which is what I want.
My problem? I can't redirect that output to a file! I push a ton of data out myStream, and really need the ability to redirect it.
Is there a limitation where only file handles associated with stdout itself, and not "CONOUT$", can be redirected to files?
Any insight on this would really, really be appreciated.
|
|
|
|
|
The following is an extract from "Conversations: Redirections", by Jim Hyslop and Herb Sutter from CUJ, to see the whole artical goto
http://www.cuj.com/experts/1903/hyslop.htm?topic=experts[^]
#include <iostream>
#include <fstream>
int main()
{
std::ofstream logFile("out.txt");
std::streambuf *outbuf = std::cout.rdbuf(logFile.rdbuf());
std::streambuf *errbuf = std::cerr.rdbuf(logFile.rdbuf());
// do the actual work of the program;
std::cout << "This would normally go to cout but goes to the log file\n";
std::cerr << "This would normally go to cerr but goes to the log file \n";
logFile << "This goes to the log file\n";
// restore the buffers
std::cout.rdbuf(outbuf);
std::cerr.rdbuf(errbuf);
}
|
|
|
|
|
Hi all. First, thanks for all the cool articles around. Really helpful.
Second, I got a dumb question:
I created a CStatic-derived class because I hate the normal groupbox MFC provided. Lets call it CBetterGroupbox.
I put in CBetterGroupbox::addMember(CWnd* member) which does member->SetParent(this). For everything that is supposedly "in" the groupbox, I call addMember. I have to do this since the draw order of MFC put all my buttons "under" the CBetterGroupbox background. It works fine. The controls are now drawn after CBetterGroupbox::OnPaint is done.
However, now when I click a button, the handler in the main dialog is not called, probably since the message map now sends the ON_BN_CLICKED messages only to the CStatic level, not to CDialog level. How do I fix this? Is there any easy way to pass all the messages a class receives up to its parent?
Desperately looking for help.
|
|
|
|
|
You can do this overriding OnCommand() and send a WM_COMMAND messages to the parent in response, such as
CBetterGroupbox::OnCommand(WPARAM wParam, LPARAM lParam)
{
CWnd *pParent = GetParent();
ASSERT_VALID(pParent);
pParent->SendMessage(WM_COMMAND, wParam, lParam);
}
This should take care of any control command messages, but it won't help with common controls that use WM_NOTIFY messages.
However, a better way would be to call SetOwner() on the child windows to set their owner to the dialog box. This will cause all the control messages to be sent to the dialog box instead of the group box. I'm not sure if this works for common controls, though. I think it does, but perhaps you can test it
Hope this helps
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|