|
You use the time_t converter just as you do with built-in conversions:
MyTime mt;
time_t time;
mt.year = 1970;
mt.month = 8;
mt.day = 11;
time = mt;
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Thanks, Michael buddie!
George
|
|
|
|
|
Hello!
I write a program that based on Microsoft's walkall example. It runs good on my PC.
But, I find on some other PCs in our lab, it will not run
successfully, although it can be compiled correctly (I setup the
SDK and IE6's library properly, I believe).
The problem is, in the walk() call, I find on some PCs,
after the call:
if (SUCCEEDED(hr = pColl->get_length( &cElems )))
it will ALWAYS return cElemns=5,
and by getting the first element, and do a get_outerHTML,
I find the HTML seems to be an empty one, always is:
However, I traced the code line by line, there didn't seem to be any code failed (at least, the calls/functions does not return failure themselves).
To my idea, I doubt the MSHTML always generate an empty HTML like above and bound it to the pointer IHTMLDocument2* m_pMSHTML, no matter what URL I give. As to my knowledge, I can't figure out which call/function may fail during the process.
Does any one has any idea of it? Which may be the cause of the above phenomenon?
(And why this only happens to some PCs, not to all PCs I can acess in the lab (all with administrator priviledge)? Although I think all the PCs in my lab have the same MSVC and SDK installed.)
Thanks a lot in advance.
PS: I can email the zipped source code if anyone need. it is 56k after zip, compiles under MSVC6 (with MFC).
|
|
|
|
|
You didn't tell us how you set it up. What page
do you navigate the control to? If you don't
one possible cause might be that different machines
are set up to use different default home pages.
If, for example, when you pull up a browser on
machine 1, and the default page is www.codeproject.com
you will get different results with the same code
if on machine 2 the default page is about:blank.
When you start the page up, what page appears in the
control?
|
|
|
|
|
Hi,
I tried right clicking on the class name in Class View and choosing Add Member Function to add an operator= function to my class, but it won't add it to the .h file like it does with other functions. Is this a known bug? Is there a fix?
|
|
|
|
|
I'm trying to add a context menu to a tray icon that appears when a user right clicks on it. I'm not getting any of the "click" messages in the window that is passed in NOTIFYICONDATA. I did notice one thing. I was using SPY++ to see if the parent window existed (it's a 0,0,0,0 invisible window). I right clicked on the window and then clicked properties. As soon as I did the window started receiving messages like crazy.
Does anyone know what's going on and what I need to do to fix it?
Here's some code snippets
CTrayWindow trayWindow;
trayWindow.CreateEx(0, AfxRegisterWndClass(NULL), "Tray Window", WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, 0); <br />
...<br />
m_iconData.hWnd = trayWindow.GetSafeHwnd();
m_iconData.uID = WM_MYMESSAGE;<br />
m_iconData.uCallbackMessage = WM_MYMESSAGE;<br />
m_iconData.uFlags = NIF_ICON | NIF_MESSAGE;<br />
Shell_NotifyIcon(NIM_ADD, &m_iconData);
CTrayWindow is instantiated in my CWinApp::InitInstance()
Thanks!
|
|
|
|
|
I remember hearing something about setting the foreground window and posting NULL messages when you are finished with the menu...
something like this:
pWnd->SetForegroundWindow();
pMenu->TrackPoupMenu(
TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD,
point.x, point.y, pWnd, NULL );
pWnd->PostMessage( WM_NULL );
Hope this helps, or points you in the right direction somehow...
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
I'm storing a large list in a CString that needs to be written to an edit control, unfortunately Message()'s fourth parameter doesn't take a CString (for when sending a WM_SETTEXT message to the edit control). So I know that I need to convert it to something else, I've tried:
TCHAR sz[1024] ;
lstrcpy(sz, sList) ;
SendMessage (hwndEdit, WM_SETTEXT, 0, (LPARAM) sz) ;
Which works when the size of sList is under 1024 but of course crashes if larger. So basically I guess I need to know how to dynamically allocate sz to the size of sList, or if there is a better way of doing this?
Thanks,
stf
|
|
|
|
|
Since you're using, you can simply do:
editCtrl.SetWindowText (strText)); If you want to use SendMessage() , you can do:
SendMessage (hwndEdit, WM_SETTEXT, 0, strText.GetBuffer(0));
strText.ReleaseBuffer(); /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
If I have a class called MyClass and three variables (var1, var2, var3), how do a create a multidimensional array of MyClass with dimensions the size of the variables. Here is an example:
class MyClass
{
int blablabla;
};
int main()
{
int i = 2;
int var1 = ++i;
int var2 = ++i;
int var3 = ++i;
MyClass ***table;
table = new table[var1][var2][var3];
...
}
I've gotten so used to C# that I forgot how to do easy things like this.
I would greatly appreciate any help.
Thanks,
Steve
|
|
|
|
|
Unfortunately allocating multidimensional arrays in C++ is not that easy as in your example
See these articles:
http://www.geocities.com/SPUR4444/prog/multidimensional.html[^]
http://cpptips.hyperformix.com/cpptips/alloc_multi_dim[^]
SHaroz wrote:
int i = 2;
int var1 = ++i; // 2
int var2 = ++i; // 3
int var3 = ++i; // 4
MyClass ***table;
The comments are wrong. You are using ++ before the variable what means that the variable is incremented before it is used.
So these comments would be correct:
int i = 2;
int var1 = ++i;
int var2 = ++i;
int var3 = ++i;
MyClass ***table;
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Thanks Diminik
Good job catching the error in my comments. I was just trying to make up a quick example of my question.
|
|
|
|
|
How would I go about (Win32) getting a handle to part of a bitmap, say the first 100 x 100 pixels?
|
|
|
|
|
Hi,
Got a bit of a perplexing problem. I'm building a Unicode DLL, which is linking to a lib I've built (also Unicode, obviously). If I build the DLL without referencing the lib, it builds perfectly. However, when I link in the lib, something in it is causing the non-Unicode MFC libraries (nafxcwd ) to be linked in too, causing the error:
LINK : warning LNK4098: defaultlib 'nafxcwd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
However, both DLL and lib are compiled with _UNICODE defined, and the lib's compiled with /NODEFAULTLIB, so I can't work out where the reference to the non-Unicode symbol is coming from. I've tried linking with /VERBOSE:LIB, but it doesn't seem to be giving any clues.
The question is, how can I find out what symbol is causing the linker to search in the nafxcwd library? Is there any linker option which will show me which symbol is being searched for when each library is being searched? Any other easy ways of solving this?
Thanks
Mark
|
|
|
|
|
Hi guys,
My MFC based activeX control exposes a method which is suppose to return a HRESULT.
how can this be implemented, When I try to add a method to my control I do not have the option of
selecting HRESULT as a return type.
Does OLE have its own version of HRESULT ?
|
|
|
|
|
I create modeless dialog. In this dialog I create a "APPLY"
button. I define a use defined message" WM_APPLY".
I want the "WM_APPLY" message sent to Doc or View class.
but acually it sends it to Mainframe,the MainFrame use
OnCmdMsg to send it Doc or View. How Can I directly
send "WM_APPLY" to View or Doc class not through MainFrame's
OnCmdmsg.
Your Answer will be appreciated very much.
wuwenguo
|
|
|
|
|
What class creates the modeless dialog box? For example, if it is created in a view class, then one solution is GetParent() and GetSafeHandle(). Otherwise, you should send a message to main frame.
Kuphryn
|
|
|
|
|
What are Crystal Reports and what are they used for??
Where can I found out info on creating them??
Thanks,
grahamoj.
|
|
|
|
|
|
This is something I noticed about using ShellExecute() and CreateProcess(). When I have this:
cout << "Start..";
ShellExecuteEx(/* I call notepad or something here!! */);
cout << "End..";
It calls the ShellExecuteEx function first and THEN the FIRST cout statement and then the SECOND cout statement i.e
(displays the notepad.exe)
Start..
End..
How do I get it to call the first cout statement, then the ShellExecuteEx() and then the second cout statement??
Also how do I get the notepad.exe to exit when I am finished doing what I do with it, in the program??
Thanks,
grahamoj.
|
|
|
|
|
Interesting. Set a delay timer right after "Start.." and see if the console displays it. Maybe it displays it so quick that you miss it.
Kuphryn
|
|
|
|
|
Flush the output stream after each line, by adding endl :
cout << "start" << endl;
ShellExecute(...);
cout << "end" << endl;
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Thanks, that worked..
grahamoj.
|
|
|
|
|
I want to create a modeless dialog from Mainframe.
I use the following statement,I don't want to use Create
Method,I prefer to use CreateEx,because I want it to be positioned anywhere on the screen. but it fails
Please tell me the reason.
m_pDlg->CreateEx(WS_EX_CLIENTEDGE,_T("ModelessDialog"),NULL, WS_POPUP|WS_VISIBLE,rect,this,
IDD_MODELESS_DIALOG);
wuwenguo
|
|
|
|
|