|
THANKS! works great
|
|
|
|
|
You're probably already using the strtok solution that Carlos gave you, but I submitted an article here that deals specifically with parsing strings. You may want to check it out.
http://www.codetools.com/useritems/cstringparser.asp
|
|
|
|
|
I am trying to create a Hyper object which has several Hyper objects as members. I then want to add the container object to the view and have all the contained objects added automatically. I want to be able to move the contained objects in unison with the main object. I don't know if this is possible but I would prefer using this method as opposed to using groups. If what I want is not possible, is there a way to access properties of individual objects by right-clicking on the object without ungrouping the group?
|
|
|
|
|
I have just upgraded my operating system to Windows 2000 and when I try to compile any programs that compiled and ran before I get a compile error 1001. I have even created a new empty program and this doesn't even compile. Obviously I need to change some sort of settings to make it compatible because these programs work on my colleague's version of 2000 so its just my machine.
Thanks for any help
Nick
|
|
|
|
|
Hi all,
In MFC, ON_MESSAGE() macro can be used to map userdefined messages. In ATL, what is the alternative macro for handling user defined messages?
Regards,
Rejeesh
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
|
Hi All,
My problem is about casting between these types.
the scenario is below.
getdocument -> getactiveelement ->
"it's a frame" I need a way of casting this IHTMLElement to IHTMLElement2 or to IHTMLWindow2
/*
IHTMLElement* pa_el;
...get_activeelement(&pa_el);
CComQIPtr<ihtmlelement2,&iid_ihtmlelement2> pa_el2(pa_el);
I have a dispatch here in pa_el2 but it seems as something is wrong because when I call doScroll, I get errors... if I cast to IHTMLWindow2... it simply returns NULL... (myframe == null)
CComQIPtr<ihtmlwindow2,&iid_ihtmlwindow2> myframe(pa_el);
How can I access to a frame object if I have it as an IHTMLElement?
Please Help...
|
|
|
|
|
If you need IHTMLElement2 just ask for it. IHTMLElment2 inherits from IHTMLElement
IHTMLElement2* pElement;
get_ActiveElement(&pElement);
|
|
|
|
|
I tried it already... but I get this error...
error C2664: 'get_activeElement' : cannot convert parameter 1 from 'struct IHTMLElement2 ** ' to 'struct IHTMLElement ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
|
|
|
|
|
Gurus
I have been trying unsuccessfully to use CFileFind to search a directory for files, I have successfully used this in the past but currently have hit the proverbial brick wall. The following code
CFileFind find;
find.FindFile(m_strDir);
while (find.FindNextFile())
{
if (!find.IsDots() &&
!find.IsDirectory())
{
CString strMsg = find.GetFilePath();
strMsg += " found.";
AfxMessageBox(strMsg, MB_OK | MB_APPLMODAL | MB_ICONSTOP);
}
}
find.Close();
should return all files that aren't current directory (.), parent directory (..) or a directory. All I get returned is . and ..
Any idea what I have screwed up?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
you need to call FindFile() first before you call FindNextFile()
i.e)
if ( ff.FindFile() )
{
while(ff.FindNextFile() )
{
do something
}
do something
this handles the last
file found case
}
|
|
|
|
|
If you have a look at the second line of code you will see that I have called FindFile(), I just didn't rap it up with an if statement.
Anyone else got any suggestions?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
From MSDN Library:
Return Value
Nonzero if there are more files; zero if this is the last file,
and the previous call to either FindFile or FindNextFile returned nonzero.
Not if no file was available
|
|
|
|
|
Hello,
I created (_mkdir) a directory from application 1.
When I try to remove it (_rmdir) from application 2, I have an error (EACCES).
I only can remove it from process 2 after process 1 is closed.
I guess process 1 is holding a reference on the opened directories.
Is there any mean to "free" all references to directories from one application ?
Thanks in advance.
PS: 1- The directory I am trying to delete is empty and the current directory is
the parent directory.
2 - I tried _rmdir, DeleteDirectory, ShFileOperation
Where there is a WISH, there is a WILL.
|
|
|
|
|
My application consists of two components: front end gui-manager and the server.
I have a bug that causes the server to crash very infrequently every other day.
Naturally I would like to find the bug, but as interim solution I want to restart the
server when it crashes. The code to do this is simple but unfortunately every time
the server crashes I get the modal pop up boxes so until a user clicks ok on the box
the gui doesn't get a "server exited" event and therefore can't restart the server.
Is there any way to disable this modal box for the specific application? Or may be there
is another way around?
Thanks,
Gregory.
|
|
|
|
|
I want to restart the server when it crashes.
If your server is a service running on W2K, you have the config option doing exactly that. You can also use SetUnhandledExceptionFilter function to disable msgbox.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi!
Maybe somebody could help me out by pointing out what's wrong with the following code:
#include <iostream.h>
class CResult
{
public:
static void SetFoo(int);
static int GetFoo();
private:
static int foo;
};
void CResult::SetFoo(int f)
{
foo = f;
}
int CResult::GetFoo()
{
return(foo);
}
int main(int argc, char* argv[])
{
CResult::SetFoo(17);
cout << CResult::GetFoo();
return(0);
}
At the linking stage of the compilation (VC++ 6.0) I get the following error:
Result.obj : error LNK2001: unresolved external symbol "private: static int CResult::foo" (?foo@CResult@@0HA)
Static___Win32_Debug/Static.exe : fatal error LNK1120: 1 unresolved externals
Since I'm far from experienced in C++/VC++ I can't figure out how to get the above sample to work. I've probably misunderstood how static members/methods work, so any help would be greatly appreciated.
Thanks,
Jimmy
|
|
|
|
|
To get rid of the compilation errors, add the following line after declaration of CResult:
static int CResult::foo = 0;
Making foo/GetFoo/SetFoo static is another story. You know that all instances of CResult will share one foo, right?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
oops, typing error: no need for another static. Just this:
int CResult::foo = 0;
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
That's it. Now it's compiling and working without a hitch.
Thanks a lot!
|
|
|
|
|
Hi!
I have a problem enumerating messages in the exe/dll. May be I was so lucky to fail on bug?
Here is what I do (m_IDs defined as CDWordArray):
BOOL CEventSource::Enumerate()
{
m_IDs.RemoveAll();
return (EnumResourceNames(m_hModule,RT_MESSAGETABLE,EnumIDsProc,(LONG)this));
}
BOOL CEventSource::EnumIDsProc(HMODULE hModule,LPCTSTR lpType, LPTSTR lpName, LONG par)
{
CEventSource * pMe;
pMe=(CEventSource *)par;
pMe->m_IDs.Add((DWORD)lpName);
return true;
}
Both functions return true, m_IDs contain the single element =1, doesn't matter, is there such event ID in the file, or not.
To check the whole structure, I've replaced RT_MESSAGETABLE with RT_DIALOG and received the full list of dialog's IDs. So something wrong with messagetable. But what ?
Any help will be greatly appreciated.
Thanks in advance.
Regards,
Gennady
|
|
|
|
|
All messages are stored in one RT_MESSAGETABLE. Have a look on MESSAGE_RESOURCE_DATA and friends.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|