|
Let us say a progam starts a DirectX window. I want to write a process that can detect all directX windows started and kill them.
modified 7-Mar-17 16:45pm.
|
|
|
|
|
Hi all,
I was wondering if someone could help me with the following problem that is occuring.
The thing is that every now and again a computer of mine, gives a message that the computer has run out of resources. So the thing is, is there any way I can handle such an event in VC++. When I try to connect to that PC throught PC Anywhere, I can't because of this message.
Can anyone help???
Thank you in advance
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi Programm3r,
You could use task manager to identify which process is abusing system resources.
And then try running Perfmon on your test pc and add various counters (for the failing process) to see why its running out of resources.
Add:
Virtual Memory
Private Bytes
Handles
regards,
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
In MFC how to achieve the functionality of selecting the multiple files . That is pressing control button multiple files can be selected.
Regards
Shikha
|
|
|
|
|
Do you need to CFileDialog class
|
|
|
|
|
You will need to use the CFileDialog class for that, as whitesky already said. To be able to select multiple files, the m_ofn.Flags should have the OFN_ALLOWMULTISELECT flag set.
The nail that stands out will be hammered down - Japenese proverb
|
|
|
|
|
I am using this code to insert data in databse,BY DOING oledb CONNECTION WITH DATABSE.....
can anybody help to get what i am doing wrong here.....i have made comment line error occure
ERROR is : cannot convert from 'unsigned short [139]' to 'char []'
<br />
HRESULT hr;<br />
hr = CoInitialize(NULL);<br />
CDataSource connection;<br />
CSession session;<br />
CCommand<CAccessor<CTQuoteAccessor> > TQuote;<br />
CDBPropSet propset(DBPROPSET_DBINIT);<br />
<br />
propset.AddProperty(DBPROP_AUTH_CACHE_AUTHINFO, true);<br />
propset.AddProperty(DBPROP_AUTH_ENCRYPT_PASSWORD, false);<br />
propset.AddProperty(DBPROP_AUTH_MASK_PASSWORD, false);<br />
propset.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR(""));<br />
propset.AddProperty(DBPROP_AUTH_USERID, OLESTR("Admin"));<br />
propset.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("C:\\MyDocuments\\ODLData.mdb"));<br />
propset.AddProperty(DBPROP_INIT_MODE, (long)16);<br />
propset.AddProperty(DBPROP_INIT_PROMPT, (short)4);<br />
propset.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR(""));<br />
propset.AddProperty(DBPROP_INIT_LCID, (long)1033);<br />
hr = connection.Open(_T("Microsoft.Jet.OLEDB.4.0"), &propset);<br />
hr = session.Open(connection);<br />
<br />
CCommand<CAccessor<CTQuoteAccessor> >cmd;<br />
CCommand<CDynamicAccessor,CRowset>commandInsert;<br />
<br />
TCHAR tszSQL[] = L"INSERT INTO TQuote (m_ID,m_DateTimeStamp,m_MarketNo,m_MarketName,m_Bid,m_Ask,m_MarketState) VALUES (Sessionid,Timestamp,a,Market,Bid,Ask,d)";<br />
<br />
hr = commandInsert.Open(session,(LPCTSTR) tszSQL,NULL,NULL,DBGUID_DBSQL,false);<br />
hr = session.Commit();<br />
<br />
CDialog::OnOK();<br />
<br />
A Million Thanks for any support
|
|
|
|
|
abrakadbra wrote: TCHAR tszSQL[] = L"INSERT INTO TQuote (m_ID,m_DateTimeStamp,m_MarketNo,m_MarketName,m_Bid,m_Ask,m_MarketState) VALUES (Sessionid,Timestamp,a,Market,Bid,Ask,d)";
use _T("") instead of L
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
After using _T("") this error :
fatal error C1057: unexpected end of file in macro expansion
|
|
|
|
|
abrakadbra wrote: TCHAR tszSQL[] = L"INSERT INTO TQuote (m_ID,m_DateTimeStamp,m_MarketNo,m_MarketName,m_Bid,m_Ask,m_MarketState) VALUES (Sessionid,Timestamp,a,Market,Bid,Ask,d)";
why not you simple use
CString tszSQL=T("INSERT INTO TQuote (m_ID,m_DateTimeStamp,m_MarketNo,m_MarketName,m_Bid,m_Ask,m_MarketState) VALUES (Sessionid,Timestamp,a,Market,Bid,Ask,d)");
as CString overload Const STring operator
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Hi,in my appliaction am using tree control which display files and folder of mycomputer , now i want is when i select images , thos images preview or thumbnail to be displyed in the form of outside tree control.
|
|
|
|
|
You can use of a CListCtrl
|
|
|
|
|
kiranin wrote: Hi,in my appliaction am using tree control which display files and folder of mycomputer , now i want is when i select images , thos images preview or thumbnail to be displyed in the form of outside tree control.
try extended List Ctrl here http://www.codeproject.com/listctrl/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Recently I'm working on a network application which is implemented with WinInet and provides HTTP access to internet.
And it works well for direct connect and HTTP proxy situation, except the case where customer's environment needs the information of domain name during proxy authentication, which means there's a domain-controller server in customer's office.
Since the WinInet API like InternetSetOption supports only the "Username" and "Password",how and where to specify the "domain" name?
I've referred to MSDN, but could NOT find information about that.
Thanks for any comments.
Chairman
|
|
|
|
|
chairman nirvana wrote: ince the WinInet API like InternetSetOption supports only the "Username" and "Password",how and where to specify the "domain" name?
Isn't InternetOpenUrl of any use
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
The program runs well under normal situation, but fails in NTLM authentication environment with domain-controller present.
I think InternetOpenUrl couldn't do help.
Thanks for your comments anyway.
|
|
|
|
|
Hi,
I can't check at this moment but did you try as a username put "username@domain" or "domain\username" ?
-----------
Mila
|
|
|
|
|
Customer told me he has tried the form of "domain\username", but failed.
Has anyone tried this scenario and got any successful achievements?
Thank you for your help, I'll ask customer try the form of "username@domain".
Chairman
|
|
|
|
|
when searching Temporary Internet Files folder why does it only show
. dir
.. dir
content.ie5 dir and
desktop.ini file after that it dont show anything and i know there is over 1200 items in that folder. how do i get it to list the files?
|
|
|
|
|
I'd guess because they're virtual folders. If this is the case you'll be able to see the contents with explorer but not the command prompt; give it a try and see if this is the case. You may have to use the shell interfaces such as IShellFolder to enumerate the contents.
Steve
|
|
|
|
|
|
Hi,
Definetly I agree with Stephen and WhiteSky - you can use API from Wininet:
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
FindCloseUrlCache
-----------
Mila
|
|
|
|
|
Do you have Windows Explorer configured to not show contents of system folders?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i have it set to show all.
|
|
|
|
|
Here's some code which shows how to use the shell interfaces to enumerate the contents of a folder, in this case the Desktop. Note that "My Computer" and the like appears but wouldn't if you used FindFirstFile and company. It's a console app using ATL smart pointers. I edited the "StdAfx.h" to just include <iostream>
and <atlbase.h>.
--------------------------------------------------------------------------------
// VDir.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <shlobj.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
void Go()
{
using namespace std;
HRESULT hr;
CComPtr<IMalloc> spAlloc;
hr = SHGetMalloc(&spAlloc);
if (FAILED(hr))
{
cerr << "SHGetMalloc failed!" << endl;
return;
}
CComPtr<IShellFolder> spDesktop;
hr = SHGetDesktopFolder(&spDesktop);
if (FAILED(hr))
{
cerr << "SHGetDesktopFolder failed!" << endl;
return;
}
CComPtr<IEnumIDList> spEnum;
hr = spDesktop->EnumObjects(
NULL,
SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN,
&spEnum
);
if (FAILED(hr))
{
cerr << "IShellFolder::EnumObjects failed!" << endl;
return;
}
LPITEMIDLIST pPIDL;
while ( (hr=spEnum->Next(1, &pPIDL, NULL))==S_OK )
{
STRRET Name;
hr = spDesktop->GetDisplayNameOf(pPIDL, SHGDN_NORMAL, &Name);
if (SUCCEEDED(hr))
{
LPWSTR pDisplayName;
hr = StrRetToStrW(&Name, pPIDL, &pDisplayName);
if (SUCCEEDED(hr))
{
USES_CONVERSION;
cout << W2CA(pDisplayName) << endl;
spAlloc->Free(pDisplayName);
}
}
spAlloc->Free(pPIDL);
}
}
int main(int argc, char* argv[])
{
OleInitialize(NULL);
Go();
OleUninitialize();
return 0;
}
Steve
|
|
|
|
|