|
linux_xjtu wrote: reviewed source code
What source code?
linux_xjtu wrote: typedef basic_ifstream<char,> > ifstream;
and even there is no "ifstream" appeared.
i wonder why
You must have been looking at the wrong source code. In my Visual Studio installation, the definition of the typedef ifstream is in C:\Program Files\Microsoft Visual Studio 9.0\VC\include\iosfwd, while the definition of basic_ifstream is in C:\Program Files\Microsoft Visual Studio 9.0\VC\include\fstream.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i am trying to adapt
http://www.codeproject.com/KB/system/AudioConfigurationManager.aspx to work under vista sp2.
Having it all running except for the interaction with the applet's button's
using i can't get it to supply me with information.
This code part gives me a headache:
ZeroMemory(&lvItem,sizeof(LVITEM));
ZeroMemory(&lState,0,sizeof(LVITEM));
ZeroMemory(&item,512);
defaultButton = handAcq->findChildWindow(appletWindow,BUTTON,DEFAULT_BUTTON);
listView = handAcq->findChildWindow(appletWindow,COMBO_BOX,NULL);
GetWindowThreadProcessId(listView,&procID);
HANDLE lView=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION,false,procID);
if (lView)
{
LVITEM *_lvi=(LVITEM*)VirtualAllocEx(lView, NULL, sizeof(LVITEM),MEM_COMMIT,
PAGE_READWRITE);
char *_item=(char*)VirtualAllocEx(lView, NULL, 512, MEM_COMMIT, PAGE_READWRITE);
lvi.cchTextMax=512;
lvi.pszText=_item;
_lvi->stateMask= (UINT)-1;
_lvi->mask=LVIF_STATE;
if (applyButton && defaultButton) //found buttons
{
// THIS DOESN'T WORK, RETURNS AN EMPTY lvitem STRUCTURE
SendMessage(listView, LVM_GETITEMSTATE, (WPARAM)0, (LPARAM)_lvi);
ReadProcessMemory(lView, _lvi, &lState, sizeof(LVITEM), NULL);
// THIS WORKS AND RETURNS THE ITEM NAMES
SendMessage(listView, LVM_GETITEMTEXT, (WPARAM)0, (LPARAM)_lvi);
ReadProcessMemory(lView, _item, item, 512, NULL);
}
There are no errors, just ignores any interaction with the applet other then retrieving strings.
What am i doing wrong?
modified on Saturday, April 25, 2009 9:02 AM
|
|
|
|
|
Hi,
The other day I just figured out the Vista has different interface for accessing mixers (volume controls) because of new security restrictions it only allow your application to see stuff in your level,
In other words - you can only set / select the audio channel that your application is using,
Look at this:
IAudioEndpointVolume Interface[^]
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
Tnx for the input, i've already given up on using the Directx SDK. That's why i took the workaround, by calling the sound applet and just manipulating the message queue. I want to toggle the Realtek HD Audio between the speaker and digital output by code. Just read the itemstrings, see if they have a image state mask and move the cursor to the other one and push the setdefault button.
The kludge given by http://www.codeproject.com/Members/odlumb for xp works in xp, just under vista the applet doesn't respond
|
|
|
|
|
snoepie wrote: SendMessage(defaultButton, LVM_GETITEMSTATE, (WPARAM)0, (LPARAM)_lvi);
Something called 'defaultButton' is a list view? Either you've got the wrong control, or your naming convention is...very, very odd!
Judging by the call afterwards, you've got the wrong control
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
blindingly obvious stupid mistake on my part.
Read over it a 1000 times. Stupid me, tnx. It's just so enormously frustrating to get a simple task done i've lost track
|
|
|
|
|
updated source code. same effect unfortunately
|
|
|
|
|
Looking in your original code, you attempt to initialise the LVITEM @ _lvi using these two lines:
_lvi->stateMask= (UINT)-1;
_lvi->mask=LVIF_STATE;
but that memory is in a different process! I think you need to use WriteProcessMemory to do that?
I just tried your code and my process crashed, probably because the address that _lvi refers to wasn't allocated in my progrm (but it is in yours?).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
bingo! needed just a fresh eye. Been at it for more then a week now. Started with directx to find out the obvious and finally hooked up with this kludge.
Works fine now. I'll upload the finished code when done as an addition to the XP version. Added commandline switches for toggling
|
|
|
|
|
when i review <iostream> showing somewhat like this,
namespace std {
extern istream cin;
extern ostream cout;
extern ostream cerr;
extern ostream clog;
extern wistream wcin;
extern wostream wcout;
extern wostream wcerr;
extern wostream wclog;
};
Such globals like cin,cout,cerr are considered to be defined in other files accoring to "extern" keyword.But I have not got where they are defined from MSDN. So i wonder if they are defined in just <iostream> ,although with extern keyword included.
Thanks very much for your reply.Appreciating.
|
|
|
|
|
linux_xjtu wrote: But I have not got where they are defined from MSDN.
They are defined in the C++ runtime library, which automatically gets linked in if you compile and link C++ code.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your concerning.
|
|
|
|
|
I only want to minimize a window if its not the desktop window (with all the icons)
Maybe I can use GetForegroundWindow() somehow ?
How can I do that ?
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
You can check return value with return value of GetDesktopWindow.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I tried this:
if (GetForegroundWindow()->m_hWnd == GetDesktopWindow()->m_hWnd)
But it doesn't work
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
How can I set the focus to the next open window after I minimize some other window ?
For example:
I have the following apps open: IE, Word, Notepad
When I minimize - Notepad is going to the task bar,
At this point I lose the focus and the other open windows cannot be minimized
(My program do minimize the current window in focus when I click something)
This is what I tried:
GetForegroundWindow()->ShowWindow(SW_SHOWMINIMIZED);
Sleep(1000); // Let it minimize ?
::GetWindow(GetForegroundWindow()->m_hWnd, GW_HWNDNEXT);
Any ideas ?
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
OK, I partially managed to do it with the following code:
GetForegroundWindow()->ShowWindow(SW_SHOWMINIMIZED);
CWnd* pCurrentWindow;
POINT pt;
GetCursorPos(&pt);
pCurrentWindow = WindowFromPoint(pt);
pCurrentWindow->SetForegroundWindow();
The problem is that it will only get the focus of windows behind the cursor (mouse)
Any idea how to get the next window regardless to the cursor location ?
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
modified on Saturday, April 25, 2009 6:11 AM
|
|
|
|
|
Development Environment:
Microsoft Visual Studio 2008, Version 9.0.30729.1
Microsoft .NET Framework Version 3.5 SP1
Microsoft Windows Server 2003 Enterprise Editions, Service Pack 2
Intel® Pentium® D CPU, 2.80GHz, 1 GB/4 GB of RAM
mssoap1.dll
Problem:
I have used mssaop1.dll interfaces to invoke the web services method.
I have used following interfaces in my code
ISoapSerializerPtr
ISoapReaderPtr
ISoapConnectorPtr
When I try to compile with mssoap30.dll it fails. My objective is to compilethis program with any version of mssaop.dll. Is there any other work around to resolve above issue with minimal code change?
Thanks,
Ramesh Kr Singh
Ramesh Kumar Singh
Software Engineer
Ness Technologies
India
|
|
|
|
|
Hi all,
i have created a service like this.its created successfully,but not started.
#define SVCNAME TEXT("Test_Service_Name")
SC_HANDLE schSCManager;
SC_HANDLE schService;
TCHAR szPath[MAX_PATH];
if( !GetModuleFileName( NULL, szPath, MAX_PATH ) )
{
printf("Cannot install service (%d)\n", GetLastError());
return;
}
schSCManager = OpenSCManager(
NULL,
NULL,
SC_MANAGER_ALL_ACCESS);
if (NULL == schSCManager)
{
printf("OpenSCManager failed (%d)\n", GetLastError());
return;
}
schService = CreateService(
schSCManager,
SVCNAME,
SVCNAME,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
szPath,
NULL,
NULL,
NULL,
NULL,
NULL);
if (schService == NULL)
{
printf("CreateService failed (%d)\n", GetLastError());
CloseServiceHandle(schSCManager);
return;
}
else printf("Service installed successfully\n");
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
please tell me how can i start a service.
or tell me how can i call another application from created service.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
See StartService function.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i m also chk this but still service not started.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What was the return value of StartService?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
its return 0. get error from GetLastError();
"The service did not respond to the start or control request in a timely fashion."
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Did you use of any firewall or anti virus and whats your OS? this code doesnt have problem I saw full code on the MSDN?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi friends ..
In my project i need to send an email to our customer using vc++.Please anybody send me an article or sample programme to send an email in vc++.Please Help me
Thanks in Advance
Anitha
|
|
|
|
|