|
colinbr wrote: Does anyone know if there is a masked timecode CEdit-based control on codeproject or elesewhere
[Masked Edit Control^]
|
|
|
|
|
If you are using VS 2008+, there's a new CMFCMaskedEdit Class[^]
(in the MFC feature pack).
You could probably implement the drag mechanism fairly easily in a
CMFCMaskedEdit-derived class.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all...
I am comparing dates which are in different format...
I want search the mails which are between the specified date and date..
Example
/////////////////////////////
Start Date = 03/28/2008 (mm/dd/yyyy)
End Date = 04/01/2008 (mm/dd/yyyy)
But the mail dates are in format ..
MailDate = 20080401 5:41:09 (yyyymmdd hhmmss).
//////////////////////////////////////////////
I want compare
if(mailDate <= firstDate && mailDate < secondDate)
{
printf("all the date between start date and end date");
}
else
{
printf("No mails found");
}
///////////////////////////////////////////////////
Sir how to compare this type of dates...
thank you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Do you mean compare by strings, i don't know any API in VC++ to compare data time directly from string. You may need to parse the date in string format to date formats supported by any of the data/time data types in vc++ and compare the data type. for Instance you may use [COleDateTime::ParseDateTime^] to parse the mail date in string to the COleDateTime and compare it with COleDateTime created with start and end date values.
for COleDateTime it supports string format of "04/01/2008 5:41:09" your custom format requires you need to parse the values, search cp for parsing date strings [Parse date time string with spirit^] may be useful.
|
|
|
|
|
If you are using MFC application then.
use
COleDateTime startdat,enddate,maildate.
startdate.ParseDateTime(Start Date,VAR_DATEVALUEONLY);//Start date is start date value
enddate.ParseDateTime(EndDate,VAR_DATEVALUEONLY);
maildate.ParseDateTime(mailDate,VAR_DATEVALUEONLY);
and then use your code
if(mailDate >= firstDate; mailDate <= secondDate)
{
printf("all the date between start date and end date");
}
else
{
printf("No mails found");
}
object will ompares according to it.
abhi
|
|
|
|
|
Your code need a bit reformatting.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I tryied to export function from the executable module.
In the same way as a dll export.
It "works" - I can see it as an export in Dependency walker utility
But:
Whan I use LoadLibrary from different executable to load it
it also work but when i call it, it always crashes inside.
(when i rewrite first exe into dll it works fain)
Is there any special steps which must be done to export function from EXE module?
viliam
|
|
|
|
|
Hi ,
Just try to debug the Exported function through the Exe where your invoking the exported function.
I hope there must be a problem with App ptr.
|
|
|
|
|
I don't know if that's going to work since the exe loaded with
LoadLibrary hasn't run so no initialization is done.
Can you even step into the loaded exe file's code with the debugger?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I don't know if that's going to work since the exe loaded with
LoadLibrary hasn't run so no initialization is done.
I agree. Probably he can only extract resources.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Probably he can only extract resources.
That was my understanding
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thankx,
I can step into the function and if function is empty
or just sets variables - it works
The problem begun whan i called some API function
GetModuleFileName(NULL, szPath, _MAX_PATH);
does not work and some others thow exception.
You probably right, there is some initialization missing
..for resource it definetelly works.
viliam
|
|
|
|
|
Hi all,
i m using SDI type application in MFC,and use MS-Access type database,
i m using CRecordset class for datatbase.
i m using a Radio Button,initial radio button is off,but the value of radio button stored in Databse is true.
or if i can change the state of radio button from check to uncheck or uncheck to check, then it save opposite value in data base,if it is TRUE then it stored in database as FALSE and Vice Versa.
i cant understand what is happened ?
please anyone can help me.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
So what happen to your previous question, you did't given feedback, it will be useful for others to know about the problem and solution.
|
|
|
|
|
hello friend,
I have created one Windows Dynamic link library dll and Win32 Application main.exe.
Dll contain thread inside it for continuos monitoring purpose.
I want to Post Message from Thread inside the dll to application which loads the dll.
For that I use #define WM_POSTMSGS WM_APP+10001 inside dll and Main application both.
When I try to PostMessage from dll to loaded application,Main.exe shows an error access violation Mydll.dll
I know something goes wrong but couldn't replicate the think.
Please give me suggestion is there any way to Post Message from Thread inside dll to main application.
abhi
|
|
|
|
|
use
<br />
HWND hwnd = FindWindow(szClassname,szTitle);<br />
PostMessage(hwnd,WM_APP+100001,wParam,lParam);<br />
where szClassName is the classname for the window and sztitle is the title of the window....if you give sztitle NULL it will post message to all the window having szClassName....
in the dll...it will work....by the way what are you using for doing that?????
there are 10 type of people in the world...
01 who understand binary.
10 who don't...
|
|
|
|
|
Thanks for your suggestion.
but My problem is not HWND hWnd handle.
If I Post message directly from exported callback fuction inside dll it works fine.
but I want to post the message from created Thread inside the dll to main application and that time it creates access violation error.
The Thread is inside dll which coninusly running and I want to post the message from thread.
abhi
|
|
|
|
|
how did you get the window handle.
|
|
|
|
|
I have creted one callback method
int MYAPI CALLBACK Init(HWND hWnd)
{
}
inside the dll.
Inside main application user first need to call Init whenever he loads the application.
abhi
|
|
|
|
|
I am able to postMessage from DLL, even application did'nt crash for Invalid window handle, What does MR. Debugger says. I think it is not the postmessage causing the access violation. post code snippet.
|
|
|
|
|
yaa I am also able to PostMessage inside Init fuction but i want to PostMessage by
see below
#include "Work.h"
CWORK *pObj=NULL;
HWND hMyWnd;
MYAPI int CALLBACK Init(HWND hWnd)
{
hMyWnd=hWnd;
pObj=new CWORK();
}
in WORK.h
#define WM_MYMSG WM_APP+10001
class CWork
{
public:
CWORK();
~CWORK();
Initialize();
}
In WORK.cpp
UINT ThreadMyProc(LPVOID lpObject);
HANDLE hThread=NULL;
extern HWND hMyWnd;
void CWORK::Initialize()
{
hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
ThreadMyProc, // thread function
(LPVOID)this, // argument to thread function
0, // use default creation flags
dwThreadId); // returns the thread identifier
}
}
UINT ThreadMyProc(LPVOID lpObject)
{
CWORK pWork=(CWORK*)lpObject;
while(true)
{
some conditions...
then I use
PostMessage(hMyWnd,WM_MYMSG,0,0x002);
}
return 0;
}
so as shown above when I PostMessage from ThreadMyProc it shows error in main application
Please check and give me suggestion anything wrong in this code and if possible givw solution that how we can post message from thread to main application.
abhi
|
|
|
|
|
AbhijitAkude wrote: yaa I am also able to PostMessage inside Init fuction
I see this in your first post itself, In my previous post i mean i can able to post message in the thread procedure.
AbhijitAkude wrote: so as shown above when I PostMessage from ThreadMyProc it shows error in main application
if crash occurs in DLL procedure application is blamed as both are one process, any way how do you conclude PostMessage is the issue, what debugger says. the above code doesn't give any hint to me, I think Initialize is called within the constructor of CWORK, what is the error you see which statement debugger points to.
|
|
|
|
|
The error is "Unhandled exception in main.exe(Mydll.dll):0xC0000005:Acess violation
I am using Win32 Application=>Windows Hello world application.
And the main.exe shows and error
abhi
|
|
|
|
|
I am repeating, to use debugger. Access violation are easily caught by debugger. How you are saying postmessage is the culprit. Does debugger points there, [Debug Tips^].
what is there in <some condition> before calling postmessage, how do you call CWORK::Initialise.
|
|
|
|
|
Hello dear friends,
I am developing a toolbar.
I've included the menu in the project's resource file.
I want to dispaly this menu when a button of toolbar clicked.
I've made the button with BTNS_WHOLEDROPDOWN style.
I want to display the floating menu using TrackPopupMenu.
the problem is when I load the menu using LoadMenu this function fails and
GetLastError() returns "The specified resource type cannot be found in
the image file" I don't understand the problem.Please help me out.
Thanks in Advanced.
ritz1234
|
|
|
|