|
That is the task I'm given. To eliminate the white space in order to make it a full row highlight without white space. It would seems more professional that way.
By the way, thanks for your reply. I will try out the WM_DRAWITEM as mentioned by Sauro Viti.
Sincerely,
arthur89kim
|
|
|
|
|
With relative paths for output file the warning appear. I have found only one solution to have such patches in Microsoft.CppBuild.targets
<VCMessage Condition="'%(_OutputFileFromLib.FullPath)' != '$([System.IO.Path]::GetFullPath($(TargetPath)))'" Code="MSB8012" Type="Warning" Arguments="TargetPath;$(TargetPath);Library;%(_OutputFileFromLib.FullPath);Lib"/>
but they are already present
Чесноков
|
|
|
|
|
I am running 2 excel files on my system . there are 2 excel.exe(server) showing in the process tab of
taskmanager .when I called GetActiveObject() function I always get the pointer of same excel . never get of another excel file . how can I get the object of every excel server running in the process
Trioum
|
|
|
|
|
http://support.microsoft.com/kb/238975
Office applications typically registers their the first instance only in the ROT. but they are supposed to register their individual documents in the ROT, so iterating through the ROT using IRunningObjectTable Interface may be the option to get the instance you want, provided you know the document which is opened with that instance.
|
|
|
|
|
can you help me with some source code
Trioum
|
|
|
|
|
eventhough multple instances of excel are running, only the first instance would have an entry in ROT. But all the instances registers the documents opened in them in ROT. Its the key to bind to that instance of excel.
say, u have more than one instances of excel apps, and want to get the instance in which "MyExcel.xls" file is opened..
void GetMyExcelInstance()
{
CApplication oExcelApp;
CoInitialize(NULL);
HRESULT hr;
IBindCtx *piBindCtx = 0;
hr = CreateBindCtx( 0, &piBindCtx );
IRunningObjectTable *piROT = 0;
hr = piBindCtx->GetRunningObjectTable(&piROT);
IEnumMoniker *piEnum = 0;
hr = piROT->EnumRunning(&piEnum);
piEnum->Reset();
ULONG nFetched;
IMoniker *piMoniker = 0;
bool bGot = false;
while(piEnum->Next(1, &piMoniker, &nFetched) == S_OK && !bGot)
{
LPOLESTR strName;
hr = piMoniker->GetDisplayName(piBindCtx, NULL, &strName);
CString csName(strName);
CoTaskMemFree(strName);
if(csName.Find(L"MyExcel.xls") != -1)
{
IDispatch *piDispObj = 0;
hr = piMoniker->BindToObject(piBindCtx, NULL, IID_IDispatch, (void**)&piDispObj);
CWorkbook oWorkBook(piDispObj);
oExcelApp = oWorkBook.get_Application();
bGot = true;
}
piMoniker->Release();
}
piEnum->Release();
piROT->Release();
piBindCtx->Release();
if(bGot)
{
}
}
do proper error checking..
|
|
|
|
|
//code is ok up to here
CWorkbook oWorkBook(piDispObj); //class for excel workbook object
// but as I called the following line errro occurs member not found
oExcelApp = oWorkBook.get_Application();
Trioum
|
|
|
|
|
did you generate wrapper classs for excel type library? those class members may vary in different visual studio versions. check your class for WorkBook object to see how it returns
Application object. it may be by get_Application() or GetApplication() or by some other means...
|
|
|
|
|
Using reduction to estimate sum of array elements leads to results differences for more than 1 thread in parallel region
#pragma omp parallel for reduction (+: sum)
for (i = 0; i < N * N; i++) {
vec3[i] = vec1[i] * vec2[i];
sum += vec3[i];
}
The difference is:
sum = 101.759239;
sum = 101.764313;
Чесноков
|
|
|
|
|
Looks like you're using float (not double ) and suffering from loss of precision adding big and small numbers.
Simple example:
float sum1 = 0.0, sum2 = 1.0;
for (i = 0; i < 10000000; i++)
{
sum1 += 1e-8;
sum2 += 1e-8;
}
sum1 += 1.0;
In a quick test, I got sum1 = 1.092107... and sum2 = 1.0
However, replacing float with double , I get sum1 = 1.09999999998803 and sum2 = 1.09999999939225.
You can get almost any answer you want in float by choosing the order of evaluation.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
yes, after I replaced with doubles results were equal
Чесноков
|
|
|
|
|
Dears
There are two audio output devices :
1. Bluetooth SCO Audio
2. Realtek HD Audio output
And if bluetooth headset connects to PC, the default output device is item 1.
I want to change to item 2. I have tried some methods, but it still unsuccess
I know MCI functions should done it, but I am not sure which functions should use..
Attachment is test code below:
#include <windows.h>
#pragma comment (lib, "winmm.lib")
#include <mmsystem.h>
#include <iostream>
#include <stdio.h>
int main()
{
int AIDChoise;
UINT nDevices = waveInGetNumDevs();
MCI_WAVE_SET_PARMS parms;
DWORD rc;
TCHAR ErrMsg[256];
WAVEINCAPS inwcps;
WAVEOUTCAPS outwcps;
for (int k=0; k < nDevices; k++)
{
waveInGetDevCaps(k,&inwcps,sizeof(inwcps));
printf(" In devname %d : %s \n",k,inwcps.szPname);
}
for (k=0; k < nDevices; k++)
{
waveOutGetDevCaps(k,&outwcps,sizeof(outwcps));
printf(" Out devname %d : %s \n\n",k,outwcps.szPname);
}
printf("Please select output device :");
scanf(" %d",&AIDChoise);
switch(AIDChoise)
{
case 0:
printf("0 ~~~~~~~~~");
parms.wOutput = 0;
rc = mciSendCommand(0, MCI_SET, MCI_WAVE_OUTPUT, (DWORD)&parms);
if ( rc != 0 )
printf("Error Msg : %s \n",mciGetErrorString(rc,ErrMsg,256));
break;
case 1:
printf("1 ~~~~~~~~~");
parms.wOutput = 1;
rc = mciSendCommand(1, MCI_SET, MCI_WAVE_OUTPUT, (DWORD)&parms);
if ( rc != 0 )
printf("Error Msg : %s \n",mciGetErrorString(rc,ErrMsg,256));
break;
default:
printf("2~~~~~~~~~");
printf("Invalid command.. \n");
break;
}
return 0;
}
|
|
|
|
|
yes, I found out...
use "waveOutMessage" function can change audio device..
|
|
|
|
|
Hi,
I would like to use MSAA to access some user interface elements belonging to other applications.
According to tools like AccExplorer or Inspect Objects, the elements I'm interested in are reachable and listed in the tree hierarchy they display.
However, when I use a custom function like WalkTreeWithAccessibleChildren from MSDN (<a href="http://msdn.microsoft.com/en-us/library/dd317975(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/dd317975(v=VS.85).aspx</a>[<a href="http://msdn.microsoft.com/en-us/library/dd317975(v=VS.85).aspx" target="_blank" title="New Window">^</a>]) I get a different tree, some elements are identical but other have a complete different set of children. The elements I want to access are not available in this tree (I've also tried with methods like get_accChild and accNavigate but it did not work).
Do you know how I can build a tree similar to the one in AccExplorer?
Thank you for your help!
|
|
|
|
|
Hi,
is there any difference between Windows Job and Scheduled Tasks?
I have used the win32_ScheduledJob class for monitoring the scheduled tasks.
But it doesn't return anything even that task in running state.
Please let me know how to create a windows job manually for testing and which win32 class to be used for monitoring?
Thanks
|
|
|
|
|
|
If possible what is the easiest way to reduce the connect inital timeout value from 3 seconds to 1 second or less? The excerpt below reduced the retries which is not good enough for my purposes.
Any suggestions would be appreciated.
Thanks
"Now, the initial timeout value - before the first connection attempt - is 3 seconds. After each retry, the amount of time to wait is doubled (3 seconds, 6 seconds etc.). The number of retries can be configured via the 'TcpMaxConnectRetransmissions' parameter in the registry - the default is set to 3 for Windows NT and 2 for Windows 2000. Thus, the first solution to the connection timeout problem is, to adjust this parameter via the Registry. However, changing the registry is a global change, affecting all applications that use Winsock and/or TCP/IP. The following Knowledge Base article (http://support.microsoft.com/default.aspx?scid=kb;en-us;120642) provides detailed information. Nevertheless, one should be careful while playing with these parameters."
|
|
|
|
|
Alan Kurlansky wrote: what is the easiest way to reduce the connect inital timeout value from 3 seconds to 1 second or less
There is no 3 second timeout for connect() function. You need to implement your own timeout mechanism or use a socket library that does. It's a short answer, hope it helps.
/M
|
|
|
|
|
On a windows(XP) machine i'm trying to inject mouse/keyboard messages (for some remote control; kind of soft-KVM-switch), which works fine as long as a user is logged in. Once the workstation is locked or no user is logged in, the injected messages seem to be ignored. I have tried both mouse_event and SendInput (unsuccessful) as well as to connect the app (runs as nt-service, userinteraction allowed) with the logon-desktop, which (regarding to api-returns) should work, but still no success. Can anyone give me an advice?
|
|
|
|
|
There is [input data] <---- object ----> [output data] program structure.
Input data is processed in a for loop with specific object (class or struct) which takes chunk of input data performs computation and saves results to output data array.
To convert it to OpenMP should I have as many object references allocated as presumed number of threads will be running to avoid its simultaneous access from multiple threads?
It will not be possible to lock the object for a single thread as the multithreading nature dissapears since only one thread at a time will be allowed to perform computation with that object.
Чесноков
|
|
|
|
|
It depends on what your object is. If the object doing the processing is a stateless functor (ideally) then just make one per thread and don't worry about locking it. However if it's got state that's relevant across the whole operation of your program you're going to have to share the object and lock it.
Cheers,
Ash
|
|
|
|
|
I'm running that code on i7 computer with 4 cores and 8 threads
N = 10000;
...
#pragma omp parallel for
for (i = 0; i < N * N; i++)
vec3[i] = vec1[i] * vec2[i];
...
Setting number of threads with omp_set_num_threads to 2, 4 and 8 the performance increase compared to omp_set_num_threads(1) is not consistent: x1.4, x1.55, x1.58
Should be we expect the rates to be: x2, x4, x8 instead?
Чесноков
|
|
|
|
|
If you have 4 cores, the highest ratio that you can theoretically expect is 4; using a number of threads higher thatn the number of cores don't produce significant advantages and can reduce the performances because to execute all of them the system has to switch the thread context a lot of times and this will waste time.
The real speed improvement could be less than expected due to the times required to create the threads at the beginning of the parallel construct and destroy them when the parallel construct terminates; if this is the case, by increasing N the rates should became better (e.g. try N = 1000000 )
|
|
|
|
|
Hi Sauro,
the i7 the original poster is using can run 8 threads simultaneously. There are 4 cores and each core is hyperthreaded.
Cheers,
Ash
|
|
|
|
|
Ops...
|
|
|
|