|
hi coders,
does somebody of you know how to change the IP of a WINNT System in VC++ ??
Thanks
da sonu
|
|
|
|
|
Sonu Kapoor wrote:
IP of a WINNT System in VC++
calling the right API interface?
Really, just entering "IP" into MSDN revealed that IPHelper might be what you want.
From there you can start to follow the references.
Glad to have helped - the only thing need to do yourself is the reading!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
is there someone who uses TVM_GETISEARCHSTRING?
t!
http://www.codeproject.com/treectrl/rgtree.asp?forumid=2494&exp=0&app=50&select=131468&df=100&tid=131468#xx131468xx
|
|
|
|
|
Hi,
I try to compile this code:
std::sort(actionlist.begin(), actionlist.end(), compareActionlist);<br />
actionlist is a vector.
But i get this error:
error C2039: 'sort' : is not a member of 'std'
I have tried to put using namespace std in the top, but that doesn't help.
Can someone help me? Thanks!
|
|
|
|
|
have you done this:
#include < algorithm >
?
WWT2D?
|
|
|
|
|
Thanks, i get now some other errors but i think i can make it.
|
|
|
|
|
Hi,
Consider a thread function:
MyThreadFunc()
{
<code> Sleep(50000);</code>
return;
}
As can be seen above that my thread blocks in the middle. What i want is that whenever user close my application, all the threads no matter what are they doing should first end gracefully but immediately. But suppose that my thread is stick on some blocking operation as shown in above code. How can i immediately cancel this blocking call and ask the thread to exit properly?? Infact i am using events after every next statements to check their status and exit my threads, but under such situations where the thread is stuck in a long blocking call my application waits like a hell. I want to immediately finish this thread. How ???
Example: In MSN messenger there is an option of cancel sign in . If we select this option then the connecting thread "immediately" stops working. Of course this thread calls various blocking Winsock calls especially for domain resolving, but it ends immediately.
|
|
|
|
|
See WaitForSingleObject in the MSDN and set the event when you want the Thread to stop.
Arjan.
|
|
|
|
|
So what kind of blocking functions are you calling? If you're using Winsock you can create a non-blocking socket and check to see if a connection has been made or a message has been sent/received using the select function. If you want, this select function can 1) not block at all (not recommended) or 2)block for a set amount of time. If you are using sockets I would loop through: telling the select function to block for an undetectable fraction of a second, check to see if the operation has completed, and repeat until the operation either completes, is cancelled, or is timed out.
-Michael Anderson- 完成の円
|
|
|
|
|
My suggestion is to make it appear that the thread exits immediately even though it doesn't. In your MSN message example, how do you know the thread stops immediately? If a dialog box goes away, maybe it wasn't controlled by the blocked thread. After all, how does it respond to your click on "cancel sign in" if the thread is blocked?
Also, are you sure the MSN messenger thread is blocked? Maybe it made an asynchronous call and is processing messages until it gets a reply.
If you absolutely have to have the thread exit immediately, you can call TerminateThread, but read the docs about why it's a bad idea.
|
|
|
|
|
Shah Shehpori wrote:
How can i immediately cancel this blocking call and ask the thread to exit properly?
In addition to the obvious answers you'll get, I thought I'd add a little apparently-not-too-well-known-something.
Depending on what the thread is blocked by, what you request might actually not be possible. There are instances when a thread hangs in the kernel, making it effectively impossible to terminate the process (the only way to terminate such a process is power off or hardware reset).
|
|
|
|
|
Umm I have no idea where to look to find out how to make my MFC program run in the system tray, can someone please point me in a general direction, much appreciated
|
|
|
|
|
|
I searched through the stuff but nothing came up, who feels like a loser now :P
|
|
|
|
|
Does the code you need?
//////////////////////
#define WM_SYSTRAY WM_USER +100
BEGIN_MESSAGE_MAP(CAppDlg, CDialog)
//{{AFX_MSG_MAP(CAppDlg)
ON_MESSAGE(WM_SYSTRAY,OnNotifyMsg)
END_MESSAGE_MAP()
///////////////////////////////////////////////////////////
// add to systray
NOTIFYICONDATA niData;
HICON hIcon;
hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
niData.cbSize = sizeof(NOTIFYICONDATA);
niData.hWnd = m_hWnd;
niData.uID = 100;
niData.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
niData.hIcon = hIcon;
niData.uCallbackMessage = WM_SYSTRAY;
sprintf(niData.szTip,"app name");
Shell_NotifyIcon(NIM_DELETE ,&niData);
///////////////////////////////////////////////////////////
// message handle
afx_msg LRESULT CAppDlg::OnNotifyMsg(WPARAM wParam, LPARAM lParam)
{
switch(lParam)
{
case WM_LBUTTONDOWN:
break;
case WM_LBUTTONDBLCLK:
this->OnRestore();
break;
case WM_RBUTTONDOWN:
....
}
Our way isn't a soft-glass
It is a mountain with path is rock
But it goes towards, forward upward the sun.
|
|
|
|
|
Hi,
Anyone knows how to implement a class similar to RichEdit control (i.e. with text formattings) and the method we can get the mouse click on some words (or "links") in its content ?
Thanks
|
|
|
|
|
hi,
I got a dll file in which one of its function process time
is about 5 seconds.
When I do iteration, the process time becomes 5 seconds x
number of iterations which makes my application very slow.
I tried to create multiple threads in my application
but it didn't have effect because those thread will
share a single thread of the dll.
According to what I've read in MSDN, all windows application
share the same dll process in memory. So if many application
use it, its process becomes slow.
My question is, Is there a way to create multiple process
of the DLL in memory? So I can use different processes of
DLL for each iteration? any pointers or any article suggestions..please..thanks in advance
Himanshu
|
|
|
|
|
I have a small challenge I need some help with. I have a
CScrollView derived class that displays columns, and each column has a header associated with it. I want the headers to always be displayed even when the view is scrolled. Thanks in advance for your response.
|
|
|
|
|
A solution could be to use two views in the frame, one for the data and one for the column header.
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
Hi,
After reading article at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvc60/html/redistribvc6.asp ... I am very surprise that we have to do a lot of steps to distribute a single Visual C++ application working with MS Access & DAO
Is there any simple way to include every thing in a single CD? Here are what I have:
a) An Visual C++ 6.0 application: Trial.exe
b) A Trial.mdb that is needed for the Trial.exe (MS Access2000)
What I need more to put in the package and install them in a PC that has Window98 (or later) without having MS Access & Visual C++?
I do know one thing, if I install in that PC ---> Visual C++ only with Access Database option ... it will work! How can I do a similiar task without installing Visual C++?
Thanks for any help
|
|
|
|
|
You need MDAC and Jet 4.0 Service Pack 3 from here[^].
Pavel
Sonork 100.15206
|
|
|
|
|
Hi All,
I have a vexing problem related to CListCtrls within nested CPropertysheets.
Very standard stuff here, the invisible CListCtrl is on CPropertyPage along with several visible CButton controls.
DWORD dwStyle = LVS_REPORT | LVS_SHOWSELALWAYS | WS_CLIPCHILDREN |
WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP | LVS_EDITLABELS ;
DWORD dwEXStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | WS_EX_CLIENTEDGE;
It must be obvious but I cannot see it.
If there are any kind souls out there - please help
Regards In Advance
Bonnie
Bonnie2
|
|
|
|
|
Do you have a group box on the property page as well? If you do, check the tab order as it can hide any controls under it. Try putting it before/after the control being hidden in the tab order.
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
How do i add multiple document/views to an MDI app??
Is there something else that has to be done other than add additional
document/view classes and AddDocTemplate statements to the InitInstance of the mainframe?
thx
perseus
|
|
|
|
|
I recently just started to design a tool to help me at work, it works kind of like a Hotel Reservation system. Before we used a program called "Calendar Creator" to manage all the reservations for a given day; however there are a lot of other ways we need to view the data as well. For example sometimes we need to submit reports on how many people are staying in certain buildings and percentages. So I decided to write a tool to manage all this. Everything is going good so far, but one problem.. I need this tool to be able to write all the added entries to a calendar. So I figured I would create a "Calendar View" that would display a calendar with all the added entries. However I soon found that there are no standard or popular calendar controls. So far ever Calendar controls I have seen are really just date pickers. So I figured I would write one myself, however I'm bad at math.. so the question.
1. Do I have to write one myself? (I don't want to re-invent the wheel)
2. If I do have to write it myself, how would I be able to tell that say Feb 10 2003 would be on a Monday?
Any help would be appreciated.
Thank you.
|
|
|
|