|
Would it be enough under win2k ? :
MSDN: If there are multiple monitors on the system, calling CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL) will create a DC covering all the monitors.
virtual void BeHappy() = 0;
|
|
|
|
|
I do believe that it's relevant to multiple monitors, but I just can't ask our users to set up
another monitor or another video card, or something like that.
I can only make some improvement in our program which I still don't know how to do it.
|
|
|
|
|
Probably the function can not understand the driver name under Win2k
and try to find a printer with the name pointer NULL...
virtual void BeHappy() = 0;
modified on Tuesday, March 30, 2010 4:58 AM
|
|
|
|
|
Yes, I agree with your point.
I found something on the internet which says it may be:
* concerning issues about "video card", like "dualhead cards that use a single chipset"
* or some "security risk" after win2k OS
But for me, neither seems to be correct
|
|
|
|
|
Anyway, I really appreciate your help.
|
|
|
|
|
Is there any inbuilt function in C-Socket Programming for retrieving the IP addresses of all PC's connected in LAN?
Don't die, until you do.
|
|
|
|
|
Just go through this article, very useful one [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
See NetServerEnum() and gethostbyname() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Now i am programming an IME for Khmer letter. that application send the VK_BACK to erase a letter befor display an onother letter.
UINT scanBack;
scanBack = MapVirtualKey(VK_BACK, 0);
scanBack =(scanBack << 16) + 1;
PostMessage(GetFocus(), WM_CHAR, VK_BACK, scanBack);
PostMessage(GetFocus(), WM_CHAR, VK_BACK, scanBack);
PostMessage(GetFocus(), WM_CHAR, 0x17A4, 0);
the above code is just a part of condition i implemented to send keystroke to any window with keyboard focus.
some applications could be process well. but some allicaions could not be process.
please let's me know as you could do.
thank.
Nam
|
|
|
|
|
|
SendInput is a better option than Keybd_event, since keybd_event is now superceded with SendInput from Vista versions, microsoft recommends to use SendInput. So i prefer you to use SendInput to aviod porting issues.
Величие не Бога может быть недооценена.
|
|
|
|
|
|
Applications may handle key strokes differently. You may press back space manually and use spy++ to see the list of messages posted to the app window. After that, try sending the same sequence to the window.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
..using VB6, i have data saved in a column of an excel file that am trying to extract. the code i have written returns only zeroes, cant figure out what the problem...any suggestion would be appreciated!
#include "stdafx.h"
#include "stdio.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
_variant_t raw_data[10];
Excel::_ApplicationPtr pApplication;
HRESULT hr = S_OK;
OleInitialize(NULL);
if ( FAILED( hr=pApplication.CreateInstance ("Excel.Application") ))
{
return 1;
}
_variant_t varOption( (long) DISP_E_PARAMNOTFOUND, VT_ERROR );
Excel::_WorkbookPtr pBook;
pBook = pApplication->Workbooks->Open("C:\\Myexcel",varOption, varOption, varOption, varOption,varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption );
Excel::_WorksheetPtr pSheet = pBook->Sheets->Item[(long) 1]; // grabs first worksheet
Excel::RangePtr pRange = pSheet->GetRange( _bstr_t( "B2"), _bstr_t("B2")); //loads column headers
int iColumn = 2;
_variant_t vItem = pRange->Item[(long) 1][(long) iColumn ];
_bstr_t bstrText( vItem );
// Load the rows
pRange = pSheet->GetRange( _bstr_t("B2"), _bstr_t("B12") );
for ( int iRow = 1;iRow < 10; ++iRow )
{
_variant_t vItem = pRange->Item[(long) iRow ][ (long) iColumn];
_bstr_t bstrText( vItem );
raw_data[iRow] = vItem;
cout << (long) raw_data[iRow];
}
// Don't save any inadvertant changes to the .xls file.
pBook->Close( VARIANT_FALSE );
// Need to quit, otherwise Excel remains active and locks the .xls file.
pApplication->Quit( );
return 0;
}
|
|
|
|
|
Whether this line is returning zero?
pBook = pApplication->Workbooks->Open("C:\\Myexcel",varOption, varOption, varOption, varOption,varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption );
Величие не Бога может быть недооценена.
|
|
|
|
|
The line is not, i put in a check to ensure that it wasnt null
|
|
|
|
|
i think the problem relies here
variant_t vItem = pRange->Item[(long) 1][(long) iColumn ];
_bstr_t bstrText( vItem );
Item property on Excel::Range returns another Excel::Range. So try 'Text 'property on the returned Range, as below..
_variant_t vItem = pRange->Item[(long)iRow][(long)iColumn];
Excel::RangePtr pSelRange = vItem.pdispVal;
_variant_t vItemText = pSelRange->Text();
cout<<vItemText.bstrVal;
|
|
|
|
|
I tried that line but i get error on the
Excel::RangePtr pSelRange = vItem.pdispVal; //new Range
am fairly new to C++, is there any kind of header that needs to be added in
other to execute that line?
the error is : error C2064: term does not evaluate to a function
|
|
|
|
|
which compiler do you use? Can't you attach the returned IDispatch* value (vItem.pdispVal) to new RangePtr object? I mean, isn't there any function some thing like pSelRange->AttachDispatch(vItem.pdispVal) ..?
|
|
|
|
|
Thanks all, i was able to discover what the problem was, i was setting icolumn to 2 instead of 1.............
|
|
|
|
|
buki86 wrote: _variant_t raw_data[10];
Shouldn't this be 11 ?
buki86 wrote: _variant_t vItem = pRange->Item[(long) 1][(long) iColumn ];
Since the range is only one cell, both the row and column will be 1 .
buki86 wrote: pRange = pSheet->GetRange( _bstr_t("B2"), _bstr_t("B12") );
for ( int iRow = 1;iRow < 10; ++iRow )
The range you are defining has 11 rows. The loop will run 9 times. Is that intentional?
Try something like:
for (int iRow = 0; iRow < 11; ++iRow)
{
_variant_t vItem = pRange.GetItem(COleVariant(iRow + 1L), COleVariant(1L));
_bstr_t bstrText(vItem);
raw_data[iRow] = vItem;
cout << (long) raw_data[iRow];
}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
how do i declare COleVariant? my compiler sees it as an undeclared
identifier....
|
|
|
|
|
It's in afxdisp.h .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi guys i would like to know how to do this i want to make my editing CEdit control know if it lost focus by a mouse click a keyboard hit, a popup window, etc
Thx
|
|
|
|
|
i don't think that's possible. any window can grab focus any time it wants, just by calling SetFocus, and it doesn't need to tell anyone why.
|
|
|
|