|
If the program requires use of ActiveX controls, they must be properly registered on the target machine(s).
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
I believe you use regsvr32 to register and regsvr32 /u to unregister.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hello ! I'm working with the MFC doc/view architecture.
I have created a class that encapsulate an ActiveX (a charting control). This is a generic class that is a pure base class (not deriveed from any other class). I did this so I can use it in the view in the following way:
void CMyView::OnInitialUpdate()
{
m_pGraph = new CChartContainer();
m_pGraph->....
}
So I made this to have a single object that handle all the functionality I need, especially dragging some lines and points on the chart.
I encounter a big problem:
How can I make a kind of eventsink map (or something that will enable me to get the charts events)?? It is a pure base class so I cannot declare a eventsink map.
Any idea of how I can handle this ?? A simple way: that will keep the object indepedance from the view (I need reusability) and enable me to catch the ActiveX events ???
I'm lost in this problem
Thanks !
|
|
|
|
|
Ok, I can derive my class from CWnd and this will do the trick (this will be much more complicated to implement but that works).
Hum, now another problem: as this 'container' is dynamically created, it receives an ID at run-time, so when I declare the eventsink map, I have a problem:
BEGIN_EVENTSINK_MAP(CChartContainer, CWnd)
ON_EVENT(CChartContainer, ChartID, 19 , OnMouseDownChart, VTS_I4 VTS_I4 VTS_I4 VTS_I4)
END_EVENTSINK_MAP()
ChartID is a member variable of the CChartContainer class. But of couorse this doesn't compile: I have the following error:
C:\MEC\Sources\P01\ChartContainer.cpp(272) : error C2597: illegal reference to data member 'CChartContainer::ChartID' in a static member function
Is there a way to define a dynamic ID (member of the CChartContainer class)???
Thanks
|
|
|
|
|
maybe you could find something intresting in http://www.codeproject.com/miscctrl/flexgriddragdrop.asp
|
|
|
|
|
Hello
I would like to build c++ application from which I can control office application - power point show. I just want to rotate slides in PowerPoint by simulating left and right arrow.
With CreateProcess function I firstly open my application (*.pps). Then I use EnumWindow function to get window handle of my application.
Is this window handle correct one? Should I search for child window? I found out that there is no child window for my application (EnumChildWindow). Why?
I try to send message like: SendMessage(apphwnd,WM_KEYDOWN,VM_RIGHT,1),
but unfortunately nothing happen.
I'm sorry if I posted message on wrong board.
Tomaz
Tomaz Rotovnik
|
|
|
|
|
First, you work with two diferent instance. Because of that SendMessage doesn't work. Try to know more about instances and exist several approach (InitInstance(), FindWindow() or EnumWindow(), ExitInstance(), Mutex, registry etc).
|
|
|
|
|
Hi,
I need to start and stop one exe from an application. I seeing the status of start and stop of the exe. The problem is out side of this application, if I try to start this exe, I get the message box saying that the exe is already running. I am unable to see the exe in the Task Manager, How can this be possible??
Regards,
Satya Prasad
|
|
|
|
|
See I dont know the exact reason, But for finding the exe, it must be having some process area, there are some APIs exists to enumerate the Process and threads.
EnumProcesses
EnumProcessModules
Then this link
http://support.microsoft.com/default.aspx?scid=KB;en-us;q178893
might help you to kill application safely.
VikramS
|
|
|
|
|
server is using MFC socket class on win2K
client using sockets on solaris 2.3
I cant seem to receive anything at Server side coz I put breakpoints in OnReceive() & Receive() of the sock function.
connection is ok coz server side shows connected IP address n port on the application window, just that no data received.
This is the CLIENT side
connectServer(&clientAddr,&sock); //see below
//fread data from a file to a buffer
send(sock,buffer,size0f(buffer),0); //
connectServer(struct sockaddr_in *clientAddr, int *sock)
{
arr[1] = "serverPC";
hp = gethostbyname(arr[1]);
*sock = socket(AF_INET,SOCK_STREAM,0)
servAddr.sin_family = AF_INET;
bcopy(hp->h_addr,&servAddr.sin_addr, hp->h_length);
servAddr.sin_port = htons(9000);
result = connect(*sock,&servAddr,sizeof(servAddr) );
}
server side goes like tis
Server.Create(9000,SOCK_STREAM,myIP);
Server.Listen();
CSock::OnAccept(int nErrorCode)
{
Accept(socket,0,0)
.......
}
void CSock::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
long dataLength;
Receive(&dataLength, 4);
if (dataLength > 0&& dataLength < 100000) //Just to make sure the client doesn't crash the server)
{
byte* message = new byte[dataLength+1];
int nRec = Receive(message,dataLength);
message[nRec] = '\0';
// ::SendMessage(hParent,WM_RECEIVE_MESSAGE,(WPARAM)m
essage,(LPARAM)nSocket);
}
CSocket::OnReceive(nErrorCode);
}
omitted the err checking codes
any idea where went wrong?
server n client code is found at
http://www.codeguru.com/forum/attachment.php?s=&postid=916238
|
|
|
|
|
I just need to implement a listening socket that can accept and receive data.
Anyone?
|
|
|
|
|
I have made my header file, and then when I want to use its functions .Net gives me the error:
.....................
error LNK2005
.....................
error LNK2005: "public: char __thiscall WsaP::Show(int)" (?Show@WsaP@@QAEDH@Z) already defined in Test.obj
It's a long time that I don't work with my programs since of it. If you can help me.
Thanks.
|
|
|
|
|
Because you have multiple invoke of this function by header or cpp files (first invoke is in test.cpp or by header files). Make diferent calling include files with invokes only one.
|
|
|
|
|
Add something similar to the following to the the .h file:
#if !defined(some_unique_identifier_here)
#define some_unique_identifier_here
#pragma once
#endif // !defined(some_unique_identifier_here)
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
How do i format text in a DHTML edit control..
There are lots of clases generated with this active x control... so i'm not sure how to use it??
Need some advice...a litle hint maybe..
|
|
|
|
|
I want to write a program which, while running, would intercept keyboard input and modify it if desired. For example, if the key '\' is pressed, my program would intercept the keystroke and then instead make the computer believe the user had typed 'hi'. Unfortunately, I don't know where to begin, any help would be appreciated.
|
|
|
|
|
On the first page of CP, Most Popular->• Three Ways to Inject Your Code into... , In that he explained how to Change the WinProc....(This is only the place where you can fool the application , by hacing WinProc)i.e when u press keyboard, you can change the stuff, ...I guess you will run that code.
regards
Balkrishna Talele
|
|
|
|
|
Look http://www.codeguru.com/Cpp/W-P/system/keyboard/article.php/c5699/
|
|
|
|
|
hi
i have an STL string object, which has a NULL char in the MIDDLE. For ex:
#include<string>
using namespace std;
....
string str = "abcdefghijklmnopqrstuvwxyz";
str[11] = 0; // str.size() still equals 26
Now i want to convert this string to _bstr_t object, retaining the NULL char and the chars after that. I tried this:
_bstr_t bstr = str.c_str();
But only first 11 chars are being copied(till NULL char). Pls help
TIA
|
|
|
|
|
A string containig a \0 in the middle is not a string in any c-derived language. You are probably better off in not trying to pretend that it is one.
Make your string a vector of bytes, and it can happily contain as many \0 as you need.
What are you trying to achieve? Maybe stepping back and taking the time to describe your problem in words will help you to find a new approach to its solution.
Sandeep Kulkarni wrote:
str[11] = 0; _bstr_t bstr = str.c_str();
But only first 11 chars are being copied(till NULL char).
Any other behaviour would be a clear violation of guarantees given by the std::string. \0 is a string terminator.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Actually the scenario is a bit different. I have a string, which needs to be encrypted first, then be supplied to another component. While encrypting a "valid" string, there is every possibility(perhaps there is!) that some of the chars be substituted by NULL char. THIS IS VERY MUCH ALLOWED HERE!!!
Now such an encrypted string needs to be passed to a method of a COM component which accepts nothing other than _bstr_t !!! Hence the problem!!
Thanx anyway,More help will be appreciated.
|
|
|
|
|
So you can't change the code of the COMponent?
And the way of encryption you need to use is also fixed?
Too bad.
bstr_t is holding strings in UNICODE encoding, and constructors and operators that take char* are converting the strings to Unicode.
Unicode strings sould be resistant to a single \0, as they are only terminated by \0\0.
Maybe you can assemble the bstr_t from your string by adding the part until the first \0, then subsequently +=ing the \0, the part until the next \0, the next \0 and so on?
Try it out.
Sorry that I am of no help here.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I am curious if anyone know of a good tutorial to learn how to make a SIMPLE client server program. All I wish to do is make a server listen on a port on my local network and a client be on all the computers of the network. What i wish to do hopefully is allow the clients to send a message to the server with various messages like "Computer user needs help" or whatever. I have seen some examples on the net but the code is simply just given and not explained and unfortunately for me I don't have enough knowledge with the winapi yet to fully understand what alot of the functions mean. I tutorial using mfc would be great. Or code that is portable to a mfc program. Your help is gratefully appreciated.I know there are programs like WinChat and Netsend and so on but thats beside the point.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|