|
Are these functions also included in your project ? If you did the first half of what I suggested ( make sure all the files are included ) then most probably the function in question is in a lib, and you've #included the headers, or you wouldn't compile, but VC doesn't know where the .lib file you need is. I suspect this is what lauren is also trying to figure out from your post.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Your problem is that you're including C header files in a C++ program.
C++ "mangles" the names of functions in order to support overloading and better type checking, and as long as the code is compiled by the C++ compiler, the compiler knows this and deals with it.
Your code is C code though, and does not include this mangling, thus the linker doesn't know how to deal with it.
If you can change the .h files yourself, then include this code at the very top of it:
#ifdef __cplusplus
extern "C" {
#endif
and this code at the very end of it:
#ifdef __cplusplus
} // extern "C"
#endif
This tells the compiler to treat everything within the curly brackets as C code rather than C++.
If you can't modify the header files (or don't think you should) then anywhere you #include the .h file put:
extern "C" {
#include "file.h";
}
|
|
|
|
|
Bonjour again!
i've got another important question: how can i set a property in ADS to be empty? i tried it with an empty string, but it doesn't work.
benedikt
|
|
|
|
|
bonjour!
i've got the following problem: i'm connected to an ADsUser Interface and try to read the adresses. but the HRESULT of the property is always E_ADS_PROPERTY_NOT_FOUND. on the win2k server the adress properties are set, but except the PostalCodes i can't read them. what's wrong?
thnx
|
|
|
|
|
derHackler,
This is correct. Properties vary in availabilty based on the provider you are using.
For example:
The WinNT:// provider gets you the user in active directory and allows you to set properties on the user such as first name, last name and etc. But if you try to set the email address you will get E_ADS_PROPERTY_NOT_FOUND. This is because the email address is not available through the winnt provider. You will need to get the user from the LDAP:// provider to be able to set the email.
Also, Make sure you are also using the correct attribute name as the provider is expecting.
http://msdn.microsoft.com/library/psdk/adsi/ds2pldap_3703.htm
Both providers use the ADsUser interface but provide different attribute features. Examine the AD Schema to determine which attributes are available from WinNT provider and LDAP provider for a User object.
http://msdn.microsoft.com/library/psdk/adsi/ds2pnt4_59wz.htm
http://msdn.microsoft.com/library/psdk/adsi/ds2pnt4_49mb.htm
Regards,
-Erik Thompson
|
|
|
|
|
thanks for your answer. but the PostalAddresses property is supported on both providers (i use LDAP). you also get the E_ADS_PROPERTY_NOT_FOUND error when you try to get a value from a property which has no value yet. but i set the addresses value and so i don't know what's wrong.
|
|
|
|
|
I'm looking for a trick to catch ALL messages and windows events in an application.
I've already used SetWindowsHookEx() with WH_CALLWNDPROC or WH_GETMESSAGE (in dll of course..) but the application doesn't catch events from others windows!!
HELP!!
|
|
|
|
|
Hello, the codegurus around the world.
Try to check CWinApp::ProcessMessageFilter(...) function.
Accroding as MSDN library,
ProcessMessageFilter is only called for messages that are posted to the message queue and is not called for messages that are send directly to the window procedure. Therefore, this function cannot be used to monitor messages that are sent (by "Windows" or by the user) to a dialog box, message box, menu, or a scroll bar.
So, it seems that only one function will not work for your requirement.
HTH?
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
CRecordset::Update() return insertion failed for CString<255 and >65535 char into Mémo(MS Access Database.Why?? I use MDAC 2.6 and ODBC with dynaset.
Please, help me!
|
|
|
|
|
CRecordset::Update() return inserion failed for CString<255 and >65535 char into Mémo(MS Access Database.Why?? I use MDAC 2.6 and ODBC with dynaset.
Please, help me!
|
|
|
|
|
Dear all,
I am encountering a problem in calling this CListCtrl function, OnItemchanged.
Whenever there is a change in selection, this functions will run 3 times!!!
And, for the first time, the string got is " ", but at the second time, it shows the right string, then it is " " again for the third time. Can I know how does it happen for running 3 times?
This is just a testing code. Actually I want to call another function whenever a selection is moved to another one, how can I do this if this function cannot work?
void CTable::OnItemchangedtable(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
POSITION pos = m_table.GetFirstSelectedItemPosition();
int i = m_table.GetNextSelectedItem( pos );
CString cs = m_table.GetItemText(i, 0);
AfxMessageBox( cs);
*pResult = 0;
}
Thank you very much !!!
Regards,
Vickie
|
|
|
|
|
why dont u use the NM_CLICK message instead?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Since my tools is for the Blind, can't use Mouse but only keyboard, i.e. up, down arrow or short-cut key instead.
|
|
|
|
|
I can't remember why there are 3 calls, but the first is to indicate that an item state is changing, selection state is being removed and the third is to indicate that an item state is changing, selection state is being set. I'm guessing that the second call is to provide access to the string and possibly change it prior to it being selected. Check further and I think you will find that the item for the first call is not the same item as the item for the subsequent second and third call.
Add the pNMListView pointer to the watch window and look at each of the member variables change for each of the three calls to the method. That might aid in your understanding of what is happening.
|
|
|
|
|
Thank you very much!!
I got how to do it now. It is to check the status of pNMListView->uNewState
and pNMListView->uOldState before operation as follow:
void CTable::OnItemchangedtable(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
UINT u = pNMListView->uNewState;
UINT n = pNMListView->uOldState;
if( u != 0 && n == 0 )
{
POSITION pos = m_table.GetFirstSelectedItemPosition();
int i = m_table.GetNextSelectedItem( pos );
CString cs = m_table.GetItemText(i, 0);
AfxMessageBox( cs);
}
*pResult = 0;
}
|
|
|
|
|
I'd like to use my VS_VERSION_INFO resource internally, to put copyright info and version numbers on my splash screen and 'About' dialog.
As far as I can tell I have to have my executable address it's own compiled file via either FindResource/LoadResource or GetFileVersion/VerQueryValue to get at this information.
Either way seems incredibly longwinded for something that (I would think) a lot of people would want to do.
Does anyone know an easy (easier?) way around this?
Cheers,
Dan
|
|
|
|
|
I am trying to add an event into the EventLog Viewer using
ReportEvent() .But it doesn't get added into the viewer?
Any ideas?
|
|
|
|
|
I am trying to add an event into the EventLog Viewer using
ReportEvent() .But it doesn't get added into the viewer?
Any ideas?
|
|
|
|
|
I have 1 exe which needs to call another exe, passing some data.
How best to call another exe within my first exe?
|
|
|
|
|
PROCESS_INFORMATION pInfo;
STARTUPINFO sInfo;
DWORD exitCode;
sInfo.cb = sizeof(STARTUPINFO);
sInfo.lpReserved = NULL;
sInfo.lpReserved2 = NULL;
sInfo.cbReserved2 = 0;
sInfo.lpDesktop = NULL;
sInfo.lpTitle = NULL;
sInfo.dwFlags = 0;
sInfo.dwX = 0;
sInfo.dwY = 0;
sInfo.dwFillAttribute = 0;
sInfo.wShowWindow = SW_SHOW;
if (!CreateProcess(NULL, "path\\second.exe",
NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo))
{
printf("ERROR: Cannot launch child process\n");
exit(1);
}
Cheers
|
|
|
|
|
I can think of three ways:
1) Use Shared memory
2) Passing a WM_DATA message to your rxing applications window (This also works for passing data between 16 & 32 bit apps).
3) Make the rxing exe a COM server.
What's your level of expertise?
Do you need more info or is this enough to get you started?
"You can lead a horse to water but a pencil has to be lead"
|
|
|
|
|
Oops, forgot to ask the obvious question (Just saw Prasanth's post )
Do you need to pass the data at application launch? (Prasanth's solution) or at run-time? (my suggestions)
|
|
|
|
|
I would like to see sample code on Prasanth's solution.
What if I need to pass an object, from 1 process to another. Is my object Thread-Safe or do I need to sync data?
I'm use to COM DLL's running under MTS & some connection points experience.
Cheers for all the help!
Gerry.
|
|
|
|
|
Hi Gerry, I need to know a few more things to be able to help.
Re: I would like to see sample code on Prasanth's solution.
It's there in his post. Prasanth is spawning a process from another process. Is this what you want to do?
Re: What if I need to pass an object, from 1 process to another.
C++ object?
COM object?
OS handle object?
Binary data 'object'?
Other(?)
Do you pass the object at from one process to the other when the second process is started?
or..
Do you pass the object when the second process is already running?
Re: Is my object Thread-Safe or do I need to sync data?
Depends on the object (See last comment) and on what you intend to do with it.
If you can describe what exactly you want to do, I will be hopefully be able to give you some better advice.
|
|
|
|
|
It's a C++ object. I want to learn more about Calling another Exe from my main exe, then letting it carry out some task, & then returning.
I would passbyref the object when the second process kicked off.
Not sure to create a new process or spawn another Thread & sync the data. Multi-threaded.
Cheers for everything.
Gerry.
|
|
|
|