|
|
The only way I can think of is to not load the 3D library (CTL3D32.DLL). I'm sure there's a way to do it on a control-by-control basis but I've never been inclined to find out.
Another option is to play around with the other styles for that control and see if any of them render it non-3D.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hi everyone.
i want to watch a special URL in the IE content
when user click it . i want to get the msg
and the url content, then i will to do some thing
but how can i make it?
for example:
there is a URL: http://hi.com/myprogram/
when user click it . i want to pop up the program
but i have no idea to do.
can anyone help me?
best regards
|
|
|
|
|
|
What steps should I do to read struct data in one application from another?
I'm trying to read a data structure in one application from another. I have the window handle of the application with me. And I also know the struct.
I need to get the structure pointer through USERDATA param of the window. In the application which owns the struct data places the address of struct data member in the window's USERDATA param by using SetWindowLong(*this,GWL_USERDATA,LONG(&st)) fn.
If a simple integer value is stored as USERDATA, I can read it by GetWindowLong(*pWnd,GWL_USERDATA) fn.
But if address of the structure data member is stored in it, I cannot read it in my application.
Should I use GlobalAlloc function for this purpose?
If so what are the necessary steps that I should do?
Please guide me!
- NS -
|
|
|
|
|
Are you writing both apps, or trying to hack into one ? If the former, then the WM_COPYDATA message is your best bet.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes. Both the applications are mine. But there will be more than one instances of the first one.
Your suggestion is good, no doubt. But if I can read the struct directly, it will be most suitable for me.
Can you suggest an idea?
Thank you.
- NS -
|
|
|
|
|
Nishad S wrote:
Your suggestion is good, no doubt. But if I can read the struct directly, it will be most suitable for me.
Then Shared Memory for Interprocess communication will be Best BET
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Well, definately not the hack you're pursuing now.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In general, you can not pass pointers between applications.
Each process has its own address space, the operating system maps the process specific address to a physical memory address. So process A address 0x00123456 may map to physical address 0x11111111, and process B address 0x00123456 may map to physical address 0x22222222. Don't even think about trying to get/pass physical address'.
You must pass the data.
As Christian said you can use WM_COPYDATA.
There are a number of other ways as well e.g. pipes, memory mapped files, ...
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thank you for the replay.
Can you give me brief explanation about GlobalAlloc(...)?
I'm thinking that it will allocate memory that can use different aplications if they get the handle. (For example clipboard data communication). Am I right?
|
|
|
|
|
No, GlobalAlloc() alone can not do what you want.
You could probably use the clipboard to do what you want but it would be a lot more work than using one of the other methods mentioned.
A handle is like a pointer in that it is specific to the application and can not be shared with another application (in general).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
VC++ 6, MFC, SP5, WinXP - Home .
I've spent the last few months writing an application for work (They found out I do some programming for fun and now it's part of my job ) Anyway, The application is done and runs fine on XP. Both the release version and debug version run well, debug shows no memory leaks or asserts (other then the asserts I want it to show.)
So anyway, I try to run it on Win 2K and the app crashes at start up. No chance for the main window to open or anything. The crash is not a GPF or a blue screen, just a small message box that states "Your program has done something I don't like and will close now. A log is being created. OK." - Well, that's not the actual message but the jest of it ...and it doesn't tell me where the darn log is!!! I know I took a lot of care to use API functions that would work all the way down to Win 95, so I'm kind of stummped. I even used some of the debugging code here on Codeproject to insert into the application during debug builds and it shows everything was A-OK.
Anyone have any ideas of where I can even start looking for the cause of this crash?
Thanks for any advice.
-- modified at 23:00 Tuesday 6th September, 2005
|
|
|
|
|
-- modified at 23:42 Tuesday 6th September, 2005
For the record, I deleted this because CP posted it twice....
|
|
|
|
|
If a log was created, it's probably in the system event log. My first step with problems like this is to create a global file object, and to use it to log how far the app gets before crashing, and work out what line is blowing up through a process of elimination.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for the idea! Sort of like a debug output screen but written to a file. That it too simple!
And off the record, your other message was deleted because you were really listening to Iron Maiden again, right?
Thanks for the help!
Paul...
|
|
|
|
|
Nah, I just got the Hollywood Rocks box set, so I have no idea who I'm listening to from one moment to the next, but it's all good...
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
If you can get your program 'started' then you should download the "Debugging Tools for Windows" form Microsoft's website. Install it. Read about running 'AdPlus to capture the 'crash' mode. Then look at the DMP file using WinDBG (have all the PDB files for your project handy) and you can probably determine exactly where and why your program crashes.
|
|
|
|
|
Problem:
I have difficulty in displaying Unicode string in Win32 console.
Test:
-Win32 Console is a character-mode application, not a byte-mode application. So even other documents said Win32 Console support Unicode, I found no sample or more details document than MSDN about this.
-I tried to used the FillConsoleOutputCharacter(Unicode development mode)
and found that the Win32 Screen Buffer is really a character-based buffer.
#include <wincon.h>
TCHAR c;
COORD crdSrc;
crdSrc.X = 0;
crdSrc.Y = 2;
for (c = 0x0000; c < 0xFFFF; c++)
{
...
FillConsoleOutputCharacter(hFile,c,sizeof(c),crdSrc,&dwConsole);
//Unicode mode: sizeof(c) = 1 character
}
The result in the output is always showing two character(???). But it can
show some following compound Unicode character: ㈪ ㈫ ㌘ ....
It make me confused now.
-I used "cmd /U" in command line. The pipe are Unicode but displaying is strill OEM.
Conclusion:
-I have a doubt that the Win32 Console Screen Buffer has one byte
per character(character-mode application). If it is actually that, it is
unable to show Unicode character in Win32 Console except some system Compound
Unicode Character.
Question:
-Can anyone help me to displaying Unicode string in Win32 Console?
-By the way, can you show me the way to read a handle(HANDLE) information. Reading STD_OUTPUT_HANDLE always causes violent access memory exception (is it secured pipe?).
Many thanks.
Le Tuan Anh
Mail to: anhlt@mt-it.com
|
|
|
|
|
Hello
How can I read another process of variable if I don`t know variable address?
If I know variable address,
I can do:
// readprocess.cpp
...
if( (string)pe.szExeFile =="A.exe" )
{
h=OpenProcess(PROCESS_ALL_ACCESS,TRUE,pe.th32ProcessID);
if(h!=NULL)
{
if(ReadProcessMemory(h,(LPCVOID)0x0012FED4,&tmp,4,&dwNumberOfBytesRead))
MessageBox(NULL,"ok","ok",NULL);
...
of course, get variable address(0x0012FED4) by other way;
//A.cpp
...
int a;
cout << &a << endl;
...
I want know how can get variable address by readprocess.cpp?
thanks!
|
|
|
|
|
I just new in visual c++ and have a copy of server and client source code. The result after I compile show Bytes recv: 21, but I want to change it so that I can send what I type. Can help me...Below is the client source code:
#include "stdafx.h"
#include "winsock2.h"
void main()
{
// Initialize Winsock.
WSADATA wsaData;
int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
if ( iResult != NO_ERROR )
{
printf("Error at WSAStartup()\n");
}
// Create a socket.
SOCKET m_socket;
m_socket = socket( AF_INET, SOCK_STREAM, 0 );
if ( m_socket == INVALID_SOCKET )
{
printf( "Error at socket(): %ld\n", WSAGetLastError() );
WSACleanup();
return;
}
// Connect to a server.
sockaddr_in clientService;
clientService.sin_family = AF_INET;
clientService.sin_addr.s_addr = inet_addr( "127.0.0.1" );
clientService.sin_port = htons( 60000 );
if ( connect( m_socket, (SOCKADDR*) &clientService, sizeof(clientService) ) == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
WSACleanup();
return;
}
// Send and receive data.
long bytesSent;
long bytesRecv = SOCKET_ERROR;
char sendbuf[300] = "Client: Sending data.";
char recvbuf[300] = "";
bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf), 0 );
printf( "Bytes Sent: %ld\n", bytesSent );
while( bytesRecv == SOCKET_ERROR )
{
bytesRecv = recv( m_socket, recvbuf, 300, 0 );
if ( bytesRecv == 0 || bytesRecv == WSAECONNRESET )
{
printf( "Connection Closed.\n");
break;
}
if (bytesRecv < 0)
return;
printf( "Bytes Recv: %ld\n", bytesRecv );
}
return;
}
|
|
|
|
|
I'm at a loss why you keep pasting all of this code here. I'd also reiterate that it's obvious that you're using code when you have no idea what it does. Copy and paste without examining the code is no way to learn.
TTjen wrote:
char sendbuf[300] = "Client: Sending data.";
char recvbuf[300] = "";
bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf), 0 );
As I said yesterday, it doesn't matter how big or small you make sendbuf, lstrlen will return the length of the string you assigned to it, which is 21. The rest of the variable just never gets sent, because it's beyond the null value which causes lstrlen to ( correctly ) stop counting. You can set this string to be any value you like, up to 300 characters, and it will send it and give you back it's length. A better approach would be to use a string class like std::string or, if you're using MFC, CString. Both give you access to the underlying char * without having to allocate any memory, or impose a length limit. then you can assign the text you type to this variable, and pass the buffer in to the send method.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Greetings All,
How does one initializes GDI+ in C++?
Thanks.
Sincerely,
Max Pastchenko
|
|
|
|
|
If you got to the appropriate section, I have a series of GDI+ articles, including one on how to get it working in VC6.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
certainly, I understand that a header file needs to be included but this is not quite what i asked. Lets say i want to start wowrking with colors once i inluded everything...
Sincerely,
Max Pastchenko
|
|
|
|
|