|
Broker2003 wrote:
Is CFile strong enough to allow a copy through a network connection (WAN) with some slow performance ?
Yes, you shouldn't have any problems at all.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
well i used CFiles to do copying in a network, that was very slow, (300MBytes in three hours!!) and it worked ok. The only one being upset was the customer, because the net installation was expensive. So I think it should be ok to use CFiles in WAN too.
Regards
G. Steudtel
|
|
|
|
|
Hello,
I want to create a toolbar with a combobox in it and to detect when the combobox is updated !!!
toolbarFont.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
toolbarFont.LoadToolBar(IDR_TOOLBARFONT);
toolbarFont is a CToolbar object;
I have created some buttons in toolbar (ID_BUTTONFONTSTYLE for example) and then :
nIndex = toolbarFont.GetToolBarCtrl().CommandToIndex(ID_BUTTONFONTSTYLE);
toolbarFont.SetButtonInfo(nIndex, ID_BUTTONFONTSTYLE, TBBS_SEPARATOR, 150);
toolbarFont.GetToolBarCtrl().GetItemRect(nIndex, &rect);
rect.top = 1;
rect.right = 400;
rect.bottom = rect.top + 250;
comboFontStyle.Create(CBS_DROPDOWNLIST | CBS_SORT | WS_VISIBLE |
WS_TABSTOP | WS_VSCROLL, rect, &toolbarFont, ID_BUTTONFONTSTYLE);
everything works fine but how do I catch an event from the combobox ???
or any other ideea how to create it... ?
thanks !
|
|
|
|
|
You should be able to catch the combo box messages inside your frame class just like any other menu/toolbar message. You may not be able to use ClassWizard to do it, so you might have to edit the code manually.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
I have a function that needs to write a fixed-size memory buffer to a binary file.
There are many windows functions which I could use ot write files, however I am only concerned with the fastest one.
Does anyone know which is the fastest function for writing a buffer to a file?
C++, W2K, XP
Thanks
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Jeremy Pullicino wrote:
Does anyone know which is the fastest function for writing a buffer to a file?
Fastest in the sense of actually writing the data, or returning control to your program the fastest?
For returning control to your program the fastest, WriteFileEx() using asynchronous (overlapped) I/O is about as quick as you can get. For actually writing the data, I'm not sure that there is much difference between the functions. You can use FlushFileBuffers() to force Windows to write the data to disk immediately rather than wait until later, if that's what you want.
Hope this helps a bit,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
For actually writing the data, I'm not sure that there is much difference between the functions.
There really is no difference. In the long run they all call the WIN32 api calls WriteFile(), OpenFile()... These functions operate on the file cache. If you are worryied about cpu cycles this is not really a problem because the disk is orders of magnitude slower than the cpu or memory so your choice does not make much difference.
John
|
|
|
|
|
Hello,
I posted a question a while back about going from Windows 2000 to XP and getting dll errors. I've come to the conclusion that the project was written in version 7.0 while I have version 7.1 of Visual Studio. Yes, turning the porject to a non-debug version will solve the missing dll errors (because the dll's are associated with the debug library). However, I wish to work with the projects in debug form. Is there a way to guarantee that all my projects are on the same version? Does .Net install a different core version depending on the install type you choose? Thanks.
|
|
|
|
|
Hello friends,
i am having a small query for all of us. i am having a Wizard sheet - 97 based application. Now i am having a banner i.e the header bitmap on the property sheet changes it color to black and white or it looses the proper color display if the windows display setting is set to 256 color. the bitmap is loosing the resolution can any one help me to initialise my own palette or bursh with help of which the bitmap can be drawn. if any one has dones such thing please do help me.
Thanx
TAKE CARE
|
|
|
|
|
I was just wondering if anyone knows how to quickly calculate very large exponents. I am playing around with some RSA encryption, but calculating a number raised to some 30 digit number takes a long time (in fact, I still have yet to see it finish). I've also looked a bit for the code that does the Pow() function, but I can't find it. Anyhow, is there a faster way to do this?
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
hi,
the fastet way would be the logarhithmic one. But I fear that during the conversion processes some significant digits might get lost. But I will be good for estimates.
The next approach will be, by using the fact, that the power is cumulative.
e.g.
3 raised to the power of 8 = 3 raised 4 * 3 raised 4 = 3 raised 2*... an so on.
a= 3;
a= a*a (=9)
a= a*a (=81)
a= a*a (=6561)
a= a*a (=43046721)
a= a/3 (=14348907) = 3 raised to the power of 15
Maybe this is a solution for making very large numbers?
Regards
G. Steudtel
|
|
|
|
|
Thank you very much! I think I see how I'll be doing it now!
Selevercin
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Hello,
I'm writing a program and i'm using Excel automation in my program.
I opend an excel document (sample.xls) with Workbooks::Open() function and now i wanna get access to document's cells.
But i don't know how to initial _Workbook object with my current excel document (sample.xls) !
I took a look at MSDN and excel automation samples, and i just found this:
Workbooks books;
_Workbook book;
LPDISPATCH lpDisp;
.
.
.
lpDisp = books.Add( covOptional );
book.AttachDispatch( lpDisp );
In this sample, the programmer first makes a new document and then uses of it.
But i don't want to do it and i just want to get handle of opened document.
Regards,
Hadi
|
|
|
|
|
Try the following code to work with an existing Excel file.
Hope that's what you need.
_Application m_app;
Workbooks m_workbooks;
_Workbook m_workbook;
Worksheets m_worksheets;
_Worksheet m_worksheet;
COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
COleVariant covTrue((short)TRUE);
COleVariant covFalse((short)FALSE);
m_app.CreateDispatch("Excel.Application");
m_workbooks = m_app.GetWorkbooks();
m_workbook= m_workbooks.Open("path_To_Your_Excel_File",
VOptional, covTrue, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional );
//Make Excel visible if you like
m_app.SetVisible(TRUE);
m_worksheets=m_workbook.GetWorksheets();
//Choose the sheet you want to work with
for(int i=1;im_worksheets.GetCount()+1;i++)
{
m_worksheet = m_worksheets.GetItem(COleVariant((short) i));
sheetName=m_worksheet.GetName();
if(sheetName=="name_of_a_sheet_in_your_excel_file")
{
break;
}
}
MS
|
|
|
|
|
Hi dear Manfred
Thanks alot for reply, it was exactly what i needed.
Best Regards,
Hadi
|
|
|
|
|
I'm developing an application which supports Speech Recognition,
in this application I want to add one button which opens the
training wizard for the Microsoft Speech Recognition, and one
button opening the Speech Properties Dialog,
can anyone tell me how this can be done?
|
|
|
|
|
If you can trace the excutable that launches the dialog, you can use ShellExecute().
hope this helps
|
|
|
|
|
Thanks!
Looked at it and it was rather easy.
To open the control panel it's just the "Control.exe" file
and to open the Speech Properties I used "Control.exe speech"
|
|
|
|
|
Hello all,
I want to open an IE window...that I have done..but i dont want any other window to be opened..after this one..I have trapped all functions to open the new window using keyboard and mouse hooks..but as i cannot disable mouse leftclick..so there is a probability that i can click on any link and if that links opens in new window..then new window will open..can anyone suggest what i need to do...any help, pointers or ideas are highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
I don't know if it will work but it might help!
Let's get some things straigt first:
If you open a link in a new window, it's not a child window, since the fact that when you close the first Iexplorer, the others are not closed.
based upon this, you can install a hook on the Iexplorer (I don't know which one, but any may do). In shared memmory or a disk file you can count how many Iexplorers are opened! if the number exceeds 1 you can post a WM_QUIT message or do anything brutal to close the window.
hope this helps .
|
|
|
|
|
Hi,
I posted this last week, and tried to work on this over the weekend but with no success. This is something that i can't seem to figure out. Can someone tell me how to do this exactly? I never really coded before and this is causing me much headaches.
This was the suggestion that I received from G.Steudtel:
Try to get the applications pointer of its CMainCommand instance, and use this pointer.
Or send/post the command to the application as if the user has selected the dialog via the menu.
Here is what I posted:
I have a modeless window and a modal window, each having their own window option that when selected bring up the corresonding window. The modal window has radio buttons on it, so when a specific reaio button is selected and ok is entered, it will display the modless window.
When I select the menu to bring up the modeless window it works fine, only opens one window or sets focus to it if it has not been created. When I select the modal window and check the appropriate radio it will display the modeless window regardless if it is created already. It will just continue to duplicate the modeless window.
Can someone help me out so that it will set focus on the open window and not diplicate it.
currently I am using this code in the OnOK method.
if (!m_pCommandOpt)
{
m_pCommandOpt = new CMainCommand(this);
if (m_pCommandOpt->Create(IDD_MAIN_TAB_DIALOG) == TRUE)
{
GetDlgItem(IDOK)->EnableWindow(FALSE);
m_pCommandOpt->ShowWindow(SW_SHOW);
}
}
else m_pCommandOpt->SetActiveWindow();
THANKS in advance.
|
|
|
|
|
Are you using the same pointer in your dialog class as you are when you use the menu? Yes, I know it's a silly question, but I can't really think of any other reason why it wouldn't work.
The other thing you could try is to send a WM_COMMAND message corresponding to your menu item, so that all the window stuff is done in the same place. That would probably simplify things. I think this was mentioned before, but it's what I would do, so I'll mention it again
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am not using the same pointer....I don't know how to get the two classes to communicate with each other. Could you please show me how to get one pointer from one class to another one? I tried to do this, but was couldn't get the code to compile correctly.
How would I do the option you mention about the WM_COMMAND? I do not totally understand what you mean by this.
THANKS FOR YOUR HELP.
|
|
|
|
|
Jay Hova wrote:
How would I do the option you mention about the WM_COMMAND? I do not totally understand what you mean by this.
Say your menu item was ID_SHOWDIALOG (for example). You would send a message to your frame window exactly the same as what Windows does when a menu option is chosen.
AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_SHOWDIALOG, NULL); Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm sorry for being so slow with this, but what does this exactly do. How will this solve my problem? Also where would i put this code. The code that I posted originally is the same code I use for both menu items...
Thanks again for your help and understanding
|
|
|
|