|
You could use EnumWindows .
In the EnumWindowsProc call GetWindowThreadProcessId and compare the process id with the one you have, if they match then that window belongs to the process in question.
You should be able to build up a list of all the windows that belong to the process.
|
|
|
|
|
Im using Visual c++ 6.0 with sql server 2000 database.
I create a new project with file database option and i select one of my big table.
Without writing another code when execute i have this error "Record set failed to open"
I don't understand, this is my code that was create automatically:
// articletestSet.h : interface of the CArticletestSet class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_)
#define AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CARTICLE
{
public:
CARTICLE()
{
memset( (void*)this, 0, sizeof(*this) );
};
wchar_t m_CODMAG[6];
wchar_t m_CODART[6];
wchar_t m_LIBELLE[26];
wchar_t m_libeltech[26];
wchar_t m_groupe[6];
wchar_t m_UNITE[3];
float m_QUANTITE;
float m_SEUILmag;
float m_PRIX_VENTE;
float m_PRIX_DOLLAR;
float m_prix_unitaire_dollar;
float m_pa_fc;
float m_LMH;
float m_LMB;
float m_encours;
wchar_t m_code_loca[6];
wchar_t m_shelf[16];
float m_aprix_unitaire_dollar;
wchar_t m_compte_charge[6];
ISequentialStream* m_image;
wchar_t m_code_arturi[6];
wchar_t m_NAME3[26];
wchar_t m_code_pe1[6];
wchar_t m_NAME4[26];
wchar_t m_code_pe2[6];
wchar_t m_name5[26];
wchar_t m_priorite[1];
wchar_t m_service[6];
wchar_t m_fournisseur[6];
wchar_t m_group2[6];
wchar_t m_group3[6];
wchar_t m_group4[6];
wchar_t m_deviseach[3];
wchar_t m_second_name[26];
wchar_t m_categorie[11];
wchar_t m_libcategorie[26];
BEGIN_COLUMN_MAP(CARTICLE)
COLUMN_ENTRY_TYPE(1, DBTYPE_WSTR, m_CODMAG)
COLUMN_ENTRY_TYPE(2, DBTYPE_WSTR, m_CODART)
COLUMN_ENTRY_TYPE(3, DBTYPE_WSTR, m_LIBELLE)
COLUMN_ENTRY_TYPE(4, DBTYPE_WSTR, m_libeltech)
COLUMN_ENTRY_TYPE(5, DBTYPE_WSTR, m_groupe)
COLUMN_ENTRY_TYPE(6, DBTYPE_WSTR, m_UNITE)
COLUMN_ENTRY_TYPE(7, DBTYPE_R4, m_QUANTITE)
COLUMN_ENTRY_TYPE(8, DBTYPE_R4, m_SEUILmag)
COLUMN_ENTRY_TYPE(9, DBTYPE_R4, m_PRIX_VENTE)
COLUMN_ENTRY_TYPE(10, DBTYPE_R4, m_PRIX_DOLLAR)
COLUMN_ENTRY_TYPE(11, DBTYPE_R4, m_prix_unitaire_dollar)
COLUMN_ENTRY_TYPE(12, DBTYPE_R4, m_pa_fc)
COLUMN_ENTRY_TYPE(13, DBTYPE_R4, m_LMH)
COLUMN_ENTRY_TYPE(14, DBTYPE_R4, m_LMB)
COLUMN_ENTRY_TYPE(15, DBTYPE_R4, m_encours)
COLUMN_ENTRY_TYPE(16, DBTYPE_WSTR, m_code_loca)
COLUMN_ENTRY_TYPE(17, DBTYPE_WSTR, m_shelf)
COLUMN_ENTRY_TYPE(18, DBTYPE_R4, m_aprix_unitaire_dollar)
COLUMN_ENTRY_TYPE(19, DBTYPE_WSTR, m_compte_charge)
BLOB_ENTRY(20, IID_ISequentialStream, STGM_READ, m_image)
COLUMN_ENTRY_TYPE(21, DBTYPE_WSTR, m_code_arturi)
COLUMN_ENTRY_TYPE(22, DBTYPE_WSTR, m_NAME3)
COLUMN_ENTRY_TYPE(23, DBTYPE_WSTR, m_code_pe1)
COLUMN_ENTRY_TYPE(24, DBTYPE_WSTR, m_NAME4)
COLUMN_ENTRY_TYPE(25, DBTYPE_WSTR, m_code_pe2)
COLUMN_ENTRY_TYPE(26, DBTYPE_WSTR, m_name5)
COLUMN_ENTRY_TYPE(27, DBTYPE_WSTR, m_priorite)
COLUMN_ENTRY_TYPE(28, DBTYPE_WSTR, m_service)
COLUMN_ENTRY_TYPE(29, DBTYPE_WSTR, m_fournisseur)
COLUMN_ENTRY_TYPE(30, DBTYPE_WSTR, m_group2)
COLUMN_ENTRY_TYPE(31, DBTYPE_WSTR, m_group3)
COLUMN_ENTRY_TYPE(32, DBTYPE_WSTR, m_group4)
COLUMN_ENTRY_TYPE(33, DBTYPE_WSTR, m_deviseach)
COLUMN_ENTRY_TYPE(34, DBTYPE_WSTR, m_second_name)
COLUMN_ENTRY_TYPE(35, DBTYPE_WSTR, m_categorie)
COLUMN_ENTRY_TYPE(36, DBTYPE_WSTR, m_libcategorie)
END_COLUMN_MAP()
};
class CArticletestSet : public CCommand<caccessor<carticle> >
{
public:
HRESULT Open()
{
CDataSource db;
CSession session;
HRESULT hr;
CDBPropSet dbinit(DBPROPSET_DBINIT);
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, "yhwha");
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);
dbinit.AddProperty(DBPROP_AUTH_USERID, "sa");
dbinit.AddProperty(DBPROP_INIT_CATALOG, "gesmed");
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, "sem1");
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1036);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
hr = db.OpenWithServiceComponents("SQLOLEDB.1", &dbinit);
if (FAILED(hr))
return hr;
hr = session.Open(db);
if (FAILED(hr))
return hr;
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);
propset.AddProperty(DBPROP_IRowsetScroll, true);
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );
hr = CCommand<caccessor<carticle> >::Open(session, "SELECT * FROM dbo.ARTICLE", &propset);
if (FAILED(hr))
return hr;
return MoveNext();
}
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_)
I learn my self
|
|
|
|
|
mikobi wrote:
hr = session.Open(db);
if (FAILED(hr))
return hr;
Shouldn't you be looking at CDaoException or CDBException to see why the Open() call failed?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hey,
can you tell me why SetButtonInfo has no effect in a CFormView. I first created a Dialog (CDialog)with a embedded Toolbar. In this case I used SetButtonInfo to enable/disable ToolbarButtons. Now I created a Dialog derived from CFormView. When I now use SetButtonInfo the button "flickers" shotly but nothing else....
Do I have to create a
ON_UPDATE_COMMAND_UI function and a status-variable for each ToolBarButton in my CFormView class, or is there an easier way?
Thank you all....
|
|
|
|
|
AnTri wrote:
Do I have to create a
ON_UPDATE_COMMAND_UI function and a status-variable for each ToolBarButton in my CFormView class, or is there an easier way?
Yes and No. You're better off to use ON_UPDATE_COMMAND_UI, and compared to that method, all other possible solutions are painfully difficult.
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.
please, help me with this problem.
the program is to parse HTTP messages. From the RFC 2616 (HTTP/1.1):
"The HEAD method is identical to GET except that the server MUST NOT
return a message-body in the response. The metainformation contained
in the HTTP headers in response to a HEAD request SHOULD be identical
to the information sent in response to a GET request."
It means the response will inlude the Content-Length header but will have no body.
How to differ response on HEAD method and on GET?
While the connection is persistent the client can send a lot of HEAD requests one by one or in another order. The headers of these (GET and HEAD) responses are identical,but in case of HEAD the parser must not parse message-body.
How to differ them?
Thank you.
|
|
|
|
|
How does one convert from CComBSTR to std::string? With std::wstring it is LPCWSTR(CComBSTR), but for std::string I get a lot of error messages
I am the handsome one in the crowd.
|
|
|
|
|
I suspect that these 'errors' have a lot to do with the differences in the character types (ANSI and Wide character types).
See this[^] MSDN article. This may help you find your solution.
I Dream of Absolute Zero
|
|
|
|
|
Is it possible in an MFC/MDI application to prevent the last window from being closed e.g. if someone accidentally clicks the 'X' on the lat window?
TIA
|
|
|
|
|
yes you can.
just overloads the WM_CLOSE event (OnClose() event handler)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks for the reply.
Is it the child frame OnClose() that I should overload?
TIA
|
|
|
|
|
it is the OnClose of the Dialog you want to prevent from closing... (the child if it is the child...)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Just overload the OnCancel() event hadler as toxcct told you
and write the following inside
void CYourDlg::OnBnClickedCancel()
{
if (MessageBox("Are you sure to exit ?","msgboxtitle",MB_YESNO|MB_ICONQUESTION) ==IDYES ) OnCancel();
}
m0n0
|
|
|
|
|
When I rotate my bitmap to a degree which is not a multiple of 90 the size of the image increases to accommodate the new rotated bitmap. E.g. 45 degrees
My problem arises, when I rotate an image of resolution 768*576 the new size increases drastically. Will it be logical to rotate and then resize the bitmap back to the original size for every rotation?
I have also tried using XForm, it works great but it does not allow me to save the rotation. Is there an alternative. If not, where do I find an algorithm to resize a
24- Bit Bitmap.
|
|
|
|
|
Hello!
I'm testing and writing my documentation.
I do not know how to calculate minimum configuration for the program.
Thanks
|
|
|
|
|
Is it for a game or application?
When testing for a game, check which configuration is needed to play the game at minimum resolution (800 x 600 or something like that) at least at 25 fps.
See how much memory (ram) your application is using. If it is more than 16, users should have at least 32 (because other applications are using ram too).
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: http://geert.yoki.org
|
|
|
|
|
How do I create a tlb-file using VS 6.0 / 2003.
_____________________________
...and justice for all
APe
|
|
|
|
|
|
toxcct wrote:
what do tbl files contain ?
it's not tbl,it's tlb,it's contain Interface decalaration in Binary Format, Understand only By COM Friendly Langauge!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
My goal is to create a dll that exposes some functions (from my classes).
This newly created dll is then going to be consumed by another application.
Don't know if a tlb-file is the right thing to do, but i've earlier imported oters tlb-files but never created my own one...
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote:
How do I create a tlb-file using VS 6.0 / 2003.
Run MIDL.exe on .idl File
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Ok, and how is the .idl file created.
If you have seen an article in this subject i'm pleased. I've searched but no success...
_____________________________
...and justice for all
APe
|
|
|
|
|
|
I have a .dll and .lib that are created by Borland CBuilder. And I want to use these two files in Visual C++. However, directly adding these files into my VC++ project generates error once I call any functions in the .dll.
What should I do so that I can re-use the Borland CBuilder .dll and .lib files in VC++?
|
|
|
|
|
Hi,
I am writing a software which generates a unique machine id for a machine based on hardware/software components.
Currently i am using the following parameters - mac address, windows serial key, c: volume info and cpu id.
I am in need of some more paramters like HDD id, Motherboard ID, CDROM-Drive id.
Is there any solution which possibly doesn't use MFC or read the registry ?
Adithya
|
|
|
|
|