|
Re: your email, sorry I don't have a sample of a tab ctrl in a dialog bar.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I want to get bytes sent and bytes received in windows 2000, I try to use IP Helper API GetIfEntry, but it seems that the bytes sent and bytes received data is changing slowly, and another problem is the bytes sent is equal to bytes received.
Would you please tell me how to fix this problem?
Thank you very much!
The program is as the following:
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"net adapters information:"<<endl<<endl;
="" pmib_ifrow="" ifrow="new" mib_if;
="" mib_ifrow="" ifrow;
="" mib_ifrow();
="" for(int="" i="1;i<2;i++)
" {
="" ifrow-="">dwIndex=i;
DWORD dret=GetIfEntry(ifrow);
if(dret!=NO_ERROR)
{
//cout<<"error index="<
|
|
|
|
|
|
*hic*
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
The Programme FTPWander(http://www.codeproject.com/internet/ftpwanderer.asp)
implement the transmission using WININET API.But as MSDN issued, CInternetFile don't Support CInternetFile::Seek(..)
for FTP File, then I just don't know how to implement resuming interrpted transmission when using WININET API.
thanks for any ideas
|
|
|
|
|
I had developed a service that run under win2k, this service uses those functions in order to prevent the user to use the keys involved, but for my surprise it only works in some computers...
The fact is that I cannot use it in an industrial PC as I would do in a normal home PC.
take a look at those functions:
<br />
<br />
DLLSCT_API bool bActivarHook(bool bActivar )<br />
{<br />
if(bActivar == true)<br />
{<br />
hHookTeclat = SetWindowsHookEx(WH_KEYBOARD_LL, HookTeclatLL, hInstDLLSCT, NULL);<br />
return (hHookTeclat != NULL);<br />
}<br />
else<br />
{<br />
if(hHookTeclat != NULL)<br />
{<br />
UnhookWindowsHookEx(hHookTeclat);<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
}<br />
<br />
<br />
static LRESULT CALLBACK HookTeclatLL(int nCode,WPARAM wParam,LPARAM lParam)<br />
{<br />
if (nCode == HC_ACTION)<br />
{<br />
switch (nCode)<br />
{<br />
case WM_KEYDOWN:<br />
case WM_SYSKEYDOWN:<br />
case WM_KEYUP:<br />
case WM_SYSKEYUP:<br />
{<br />
LPKBDLLHOOKSTRUCT p = (LPKBDLLHOOKSTRUCT)lParam;<br />
bool bEliminarPressioTecla = false;<br />
<br />
if ((p->flags & LLKHF_ALTDOWN) != 0)<br />
{<br />
bEliminarPressioTecla = (p->vkCode == VK_TAB) || <br />
(p->vkCode == VK_ESCAPE) ||<br />
(p->vkCode == VK_F4) ||<br />
(p->vkCode == VK_LWIN) ||<br />
(p->vkCode == VK_RWIN);<br />
}<br />
else if ((GetKeyState(VK_CONTROL) & 0x8000) != 0)<br />
{<br />
bEliminarPressioTecla = (p->vkCode == VK_ESCAPE) || <br />
(p->vkCode == VK_F4) ||<br />
(p->vkCode == VK_LWIN) ||<br />
(p->vkCode == VK_RWIN);<br />
}<br />
else<br />
{<br />
bEliminarPressioTecla = (p->vkCode == VK_LWIN) ||<br />
(p->vkCode == VK_RWIN) ||<br />
(p->vkCode == VK_ESCAPE);<br />
}<br />
<br />
if (bEliminarPressioTecla) <br />
{<br />
return 1;<br />
}<br />
<br />
break;<br />
}<br />
}<br />
}<br />
<br />
return CallNextHookEx(hHookTeclat, nCode, wParam, lParam);<br />
}<br />
when I start windows by default I start that service automatically.
but it don't prevent those keystrokes in the industrial PC that I'm using now...
I will contact my supplier in order to know which differences are between that industrial PC and the "normal" ones, but as far as I can see the only difference is that it need to be configured as an american keyboard...
Is there any way in which I can see which key is being pressed, or somewhere where I can find information related (keyscan codes...)
As always thank you very much...
|
|
|
|
|
i have buy many books about MFC.. but i can't find helpFULL information in them ...
maybe somebody knows any GOOD links/ttorials about MDI framework programming,
what i can simply download them and study at home ... !?!?
PS: it's better if it wont be about document/view ....
PPS : it is not enoughtwith examples on codeguru codeproject :P
PPPS: sory for my ENG...
----------------------------
never stop coding.
|
|
|
|
|
I use the T2CA() macro to convert a string (UNICODE or non UNICODE - the code should work with both systems) to a char* string (each character = 1 byte) to save it to a file.
The code looks like:
...
USES_CONVERSION;
DWORD dwWrittenBytes;
if (!WriteFile(m_hFile, T2CA((LPCTSTR) str), str.GetLength(), &dwWrittenBytes, NULL) ||
dwWrittenBytes != (DWORD) str.GetLength())
{
...
}
...
The problem is that when I have a string like "Büro" (a german word), the T2CA() macro removes the "ü" in the string and saves the string "Bro" to the file!
So, how can I convert a string (UNICODE / non UNICODE) to a char* without removing some characters (like ü,ö,...)?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
The following works just fine for me:
#include <atlbase.h>
#include <iostream>
#include <fstream>
using namespace std;
int main(void)
{
USES_CONVERSION;
ofstream ofs("out.txt");
ofs<<W2CA(L"Büro")<<endl;
return 0;
} Maybe the problem is in the third parameter of the call to WriteFile . Shouldn't it be str.GetLength()*sizeof(TCHAR) ?
Correction: This is obviously not the problem, since you're writing ANSI strings.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Correction: This is obviously not the problem, since you're writing ANSI strings.
Yes! This is not the problem! It's just a problem of the conversion (UNICODE -> ANSI)!
Please take a look on my reply to the message of Maximilien Re: UNICODE problem!.
Thanks!!!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Why can't you just save the UNICODE string ? why the conversion ? WriteFile writes a void buffer, just just need to set the lenght correctly ( as stated by the other poster )
Max.
|
|
|
|
|
Because, when I write the UNICODE string to file, every character is 2 byte wide! So, when I reload the file on a other system (application - non UNICODE), the system (application) sees the string wrong, because it means, that there is a simple char* string in the file and no UNICODE (2 byte) string!
Example:
- My PocketPC application (UNICODE) writes some measurement data in a ASCII file.
- I load the measure data file on my desktop pc (non UNICODE).
So, that I can use the same source code on both systems (PocketPC & PC) I write the measure data in simple ASCII form (1 byte) in a file! So, both system can load and store the measure data!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
_ConnectionPtr pCon;
pCon.CreateInstance(...);
pCon->CreateInstance(...);
My question is how is that we are able to use both the ways
Can anyone answer me please ?????
|
|
|
|
|
|
why is it overloaded when one way can server the purpose ?
|
|
|
|
|
Anyone willing to tell me how to restore the unicode build option in the active confiuration for VS6? Hoping it will be quicker to ask here then go back to the office and get my books.
Thanks
-Mel
---------------------------------------------
Be good! But if you can't be good, at least be good at it and try not to get any on ya!
-mjf
|
|
|
|
|
Menu Build -> Set Active configuration -> Unicode
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
That was I had thought I would need to do when I removed it from the build on the project I needed from. However, the only options I have to choose from in the Build-> Set Active Configuration are Win32-Release and Win32 Debug. Any idea how to get that (the unicode build) option back into the Active configuration? I have also looked for it in
Build->Configurations... but did not find it there to be added.
-Mel
---------------------------------------------
Be good! But if you can't be good, at least be good at it and try not to get any on ya!
-mjf
|
|
|
|
|
I have an MDI application with 2 views . One is the default one created by AppWizard (which is a FormView ) and the other one was which I added to the framework ( A CtreeVIew) .
I am able to get a print preview for the First View but not for the Second View . Why ?
What should i be doing to get a print preview for the other view too ?
Some insight into this would be appreciated .
|
|
|
|
|
When you select print preview/print from the file menu, the command gets routed through to the active view. To get the print/preview working for your 2nd view, you need to also route the calls to OnBeginPrinting(), OnEndPrinting(), OnPrint() and OnPrepareDC() through to your 2nd view.
CDocument *pDoc = GetDocument() ;
POSITION pos = pDoc->GetFirstViewPosition() ;
CView *pView = pDoc->GetNextView(pos) ;
if (pView->IsKindOf(RUNTIME_CLASS(CTreeView))
pView->OnPrint() ;
else if (pos)
{
pView = pDoc->GetNextView(pos) ;
if (pView->IsKindOf(RUNTIME_CLASS(CTreeView))
pView->OnPrint() ;
}
The above code would have to be in each of the mentioned functions and call through to the other views printing support functions.
You will have some issue such as page numbering etc to deal with.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Could you tell me the way to change the font of menu as well as its items in a application.
Thanks.
|
|
|
|
|
Well, I did it in a Dialog, I suppose it's similar in a menu:
BOOL CDialogoCargos::OnInitDialog()
{
CDialog::OnInitDialog();
CFont m_Font;
m_Font.CreateFont(45,0,0,0,100,FALSE,FALSE,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_SWISS,"Arial");
CEdit * pEdit;
pEdit = (CEdit *)GetDlgItem(IDC_EDIT_CARGOS);
pEdit->SetFont(&m_Font,FALSE);
return TRUE;
}
This changes the font an edit box of my dialog.
Hope this helps.
|
|
|
|
|
I've been going round and round for a few hours now, and can't see what's wrong with my application. I have a doc/view application that uses multiple static splitter windows for the views. I created a menu and added handlers for both the command and update messages, in the view class. For some reason, the update message handler is not called prior to displaying the menu, and consequently, the menu is not set up properly (Checked items are not updated). I have verified with another application that works properly that the message maps are created properly.
I realize this is a fairly wide open description of a problem, but so far, I've received excellent suggestions (solutions) for problems I've had in the past with a simple description like this.
Any suggestions on where to look?
Thanks in advance.
|
|
|
|
|
At a guess, I would say that the ON_COMMAND_UI handler come through to the first view added and not those supported in the splitter windows. If you undate handlers are in the spliiter window added views then they would not be called. You have to implement some kind of mechanism which would route these checks through from the first view to these sub-views to allow them to update/act on the commands.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|