|
No.You can't do that either.
|
|
|
|
|
|
In CFileDialog, How to make the EditControl which displays selectd file name, Read Only??
My problem is its accpeting a file name if user types file name rather than selecing.
Thanks in advance
|
|
|
|
|
dear all,
how can i retrieve the path of My Documents folder for specific users (say guest) ? is there any function which returns the path.
my documents folder has different location in windows 9x and Xp........any way out?
rIsHaBh
|
|
|
|
|
LPITEMIDLIST pidl;<br />
<br />
HRESULT hr = SHGetSpecialFolderLocation(NULL, , &pidl);<br />
<br />
char szPath[_MAX_PATH];<br />
SHGetPathFromIDList(pidl, szPath);<br />
<br />
LPMALLOC pMalloc;<br />
<br />
hr = SHGetMalloc(&pMalloc);<br />
<br />
pMalloc->Free(pidl);<br />
<br />
pMalloc->Release();<br />
<br />
strcat(szPath , "\\Folder");
|
|
|
|
|
Or even simpler:
if ( SHGetSpecialFolderPath( NULL, pszMyDocFolder, CSIDL_PERSONAL, FALSE ) )
return pszMyDocFolder;
or:
if( SUCCEEDED( SHGetFolderPath( NULL,
CSIDL_PERSONAL,
NULL,
0,
pszMyDocFolder
)
)
)
{
return pszMyDocFolder;
}
depending on which version of the SDK you have installed.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
|
Hello, everyone!
I want to get the current bandwidth (input and output respectively) of a Windows system, for example, 20.2kB for input and 30.1kB for output.
Where can I find some sample codes?
Thanks in advance,
Geo
|
|
|
|
|
For Windows NT-based systems, look at the Performance Data Helper API. You'll be interested in the Bytes Received/sec and Bytes Sent/sec counters on the Network Interface object, I think.
|
|
|
|
|
Thanks, Mike buddy!
I have taken some time to read the API you introduced to me. They are really helpful. I am using the following source code to get in/out traffic bandwidth, but the output is always zero. Can you help?
Source Code:
----------
#include <windows.h>
#include <conio.h>
#include <stdio.h>
#include <pdh.h>
#include "iphlpapi.h"
#include "Iptypes.h"
#include "Iprtrmib.h"
#pragma comment(lib,"iphlpapi.lib")
int main (int argc, char** argv)
{
unsigned long pOutBufLen = sizeof (IP_ADAPTER_INFO);
IP_ADAPTER_INFO AdapterInfo;
memset (&AdapterInfo, 0, sizeof (IP_ADAPTER_INFO));
MIB_IFROW ifrow;
DWORD last_sent, last_recv, current_sent, current_recv;
DWORD diftime, dlwinspeed, upwinspeed, dw_refreshtime;
if( GetAdaptersInfo(&AdapterInfo, &pOutBufLen) != ERROR_SUCCESS ){
printf("Could not open default interface!");
return ( 0 );
}
ifrow.dwIndex = AdapterInfo.Index;
if( GetIfEntry( &ifrow ) != NO_ERROR ) {
printf("Could not open default interface!");
return ( 0 );
}
while (1)
{
current_sent = ifrow.dwOutOctets - last_sent;
current_recv = ifrow.dwInOctets - last_recv;
last_sent = ifrow.dwOutOctets;
last_recv = ifrow.dwInOctets;
printf ("Octs out: %ld\n", ifrow.dwOutOctets);
printf ("Octs in: %ld\n", ifrow.dwInOctets);
diftime=(GetTickCount()-dw_refreshtime);
dlwinspeed = current_recv/diftime;
upwinspeed = current_sent/diftime;
dw_refreshtime=GetTickCount();
printf ("Band in: %ld\n", dlwinspeed);
printf ("Band out: %ld\n", upwinspeed);
Sleep (5000);
}
return 0;
}
----------
Best regards,
Geo
|
|
|
|
|
Hi, I'm having trouble adding a dialog to my mmc snap-in.
the problem occus when I create a dialog in response to a menu command. while the dialog works fine if the menu command is from the context of a top-level scope item, the actual dialog is offset within it's own frame if it comes from a second level menu item.
any help would be much appreciated
|
|
|
|
|
hi,
i using cdatetimectrl for registration form. for taking package need to add any dll for this control. i control not shown in the form. oninitdialog is failed i think this is due to the control. any one help to me.
thanks in advance.
Murali.M
|
|
|
|
|
Try using AfxOleInit()in the constructor of the dialog.
|
|
|
|
|
hi,
thanks for ur guide. actually my problem is after installing setup for the application and then the problem occurs. it's working fine on running source. i solved this problem. problem is mscomct2.ocx is not included while taking setup or package. after inserting the file. now working correctly.
once again thanks for guide.
Murali.M
|
|
|
|
|
From a different application, I tried to get other application handle using "HINSTANCT hInst = GetWindowLong(hWnd, GWL_HINSTANCE);" which I am using in the function "HHOOK hHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hInst, GetWindowThreadProcessId(hWnd, NULL));".
But the handle returned by "SetWindowsHookEx()" is NULL (because of 'hInst').
Could someone help me to resolve this problem by suggesting a alternate solution for this?
Thanks in Advance,
Rajarajan V.
Rajarajan Veerichetty.
IBM Software Labs,
Bangalore
Mobile: +91-0-9845443206
|
|
|
|
|
The second parameter is NOT the HINSTANCE of the appliction you want to hook, but the HINSTANCE of the dll contaning the hook procedure.
so you can write a DllMain function, and store the HINSTANCE of the dll in a global viriable.when you call SetWindowsHookEx, use the global viriable as the second parameter.
|
|
|
|
|
Hi,
I am basically, C, VB, VB.NET programmer. I developed FTP client in vb.
But, I need to develop the FTP Client in VC++. Can anybody suggest me the ideas and links for developing the FTP client programme using vc++. and where to start with ?I have idea on vc++ and MFC. and I need to do it using sockets instead of wininet.
thanking you
Regards
Praveenp
|
|
|
|
|
There are many sites dedicated to Winsock all over the web...if you just type Winsock API into Yahoo Search you'll find. Also I have the book, Windows Sockets Network Programming, which is pretty thorough on the subject. You might want to give it a look see over at Amazon.com
|
|
|
|
|
I Create an application using SDI structure, I want to display the first screen as an HTML page, how could I do that ?
|
|
|
|
|
Derive your view class from CHTMLView!
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Can anyone tell me how to access/override/hook a rich edit control's select all (Ctrl + a). It throws up an error when trying to make any change to the selection or even select all a second time if there's more than one character for text.
For some reason, if there's only one character, then it works just dandy. It says there's an assertion error in "array_d.cpp" and so I assume it's doing something that doesn't mesh with my method of serializing the data (into DWordArrays). So, if anyone knows exactly what it IS doing (like what messages it's sending where, and how to get at them), that'd be great.
halblonious
|
|
|
|
|
I have no idea about your problems but I wait for ON_WM_KEYDOWN()
That's how I'm doing something on paste operation CTLT+V :
void MyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if ( (nChar == 0x56) )//VK_V
{
if ( GetKeyState(VK_CONTROL) & 0xff00 )
{//do something}
}
}
Mickey
|
|
|
|
|
Wouldn't be handling WM_PASTE (WM_COPY , WM_CUT , WM_CLEAR ) better?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
That was only an example. AFAIK there's no special messages for CRTL+A or other non standard combinations. I must also say I didn't know messages you mentioned
Mickey
|
|
|
|
|
Thanks for the reply, and I may have to resort to that, but I'm trying not to have to subclass the rich edit if I can help it. There must be some other way, I'm hoping.
halblonious
|
|
|
|