|
If you choose ATL-Service as the project type it will register for you.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
thks a lot
Proper Planning is way to success
|
|
|
|
|
|
I need to know how many 'potentialy-visible' items are in the tree.
Lets say for instance we have 2 items at the first level and one of them has 2 children. if they are both not-expanded the number is 2, if one is expanded the number is 4.
Sounds simple, but it doesn't look like there's a method to return this.
GetCount() returns the sum of items in the tree, even the folded ones.
GetVisibleCount() returns the amount of items placeable in the tree window.
thanks
|
|
|
|
|
You need to traverse the tree with a recursive function and checking each item's state mask using GetItemState(hItem, TVIS_EXPANDED) to see if the TVIS_EXPANDED flag is set. If the flag is set then increment a counter.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
I was hoping for something supplied by CTreeCtrl
It's just that doing this every-time (and it happens many times) seems expensive. perhaps i'll monitor expansion/collapsion myself and keep a count.
|
|
|
|
|
I've ended up using:
int CMyTree::GetNumPotentiallyVisibleItems()
{
int count = 0;
HTREEITEM ti = GetRootItem();
while (ti)
{
ti = GetNextVisibleItem(ti);
count++;
}
return count;
}
|
|
|
|
|
I've finished a recent project and I need to distribute to others. I've compiled it as release however the application refused to work on a machine without Visual C++. So how would I solve this problem. Some features that may be causing the problems are the ActiveX control FlexGrid, the modeless dialogs.
Any suggestions much appreciated
Kind Regards
Caoimh
|
|
|
|
|
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..
|
|
|
|