|
You need to do what ? Could you be a bit more specific ?
If you need to use a progress control, familiarize yourself with CProgressCtrl class in MFC. This class represents a progress control that can be stepped through to represent the advances during a lenghty operation.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Unless you know how long the other program is going to run and how long it has run (e.g., it has run 13 of 17 minutes, so the control will reflect 76% completion), a progress control is of no use here. Make sense?
You might want to further explain what you are after.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want to open an image sequence or an avi file, and i want to process it frame by frame. Then i will show the result in a window (i mean in a dialog ).
How can i do this in mfc? The first step is, i will open an avi file and play it on the screen (in a window).
|
|
|
|
|
Have you tried CAnimateCtrl ?
|
|
|
|
|
I have a CWebBrowser2 control on my dialog. I navigate it in a worker thread.
It works on mostly computers, but on a few computers it can't browse the URL content.
I have monitored these status:
"NavigateError"
"NavigateComplete2"
"DownloadComplete"
"DocumentComplete"
On those computer that the CWebBrowser2 control refuse to work there is no "NavigateError", but after "DownloadComplete" there is nothing to happen, so I think there is something wrong in the display process, but I have no idea about the wrong and how to solve it. (winXP,win2k, ADSL)
Any suggestions?
|
|
|
|
|
Hi,
I have defined a new TreeCtrl in my project with checkboxes. What I would like to do is, that these checkboxes have a third state. Not only checked and not checked but also, the third state from the normal checkboxes (checked but disabled).
Is there any way to do this without bitmaps???
Thank you in advance!
Xia.
|
|
|
|
|
I have constant connection to the .mdb '97 file and use local variables for executing temporary queries:
CDaoQueryDef query(&db);
query.Create("", NULL);
query.SetSQL(strSQL);
query.Execute(strSQL);
...
query.SetSQL(strSQL);
query.Execute(strSQL);
When i execute 1000 INSERT/DELETE statement, I have more than 35MB memory lost, but when I comment just the execution lines, I have no memory losts.
Is this some DAO enternal caching that may allocate memory, cause I can't find any other reason?
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
i wrote the following code
FILETIME ftNow;
SYSTEMTIME ftSys;
FILETIME ftTemp;
GetSystemTimeAsFileTime( &ftNow );
FileTimeToSystemTime(&ftNow,&ftSys);
SystemTimeToFileTime(&ftSys,&ftTemp);
here the problem is
ftTemp.dwLowDateTime != ftNow.dwLowDateTime
why?
but if i use
CoFileTimeNow(&ftNow) instead of GetSystemTimeAsFileTime( &ftNow );
the code works fine
why?
does any one know about it?
how can i get the actual file time as ftNow from the system time.
|
|
|
|
|
In either case, the wMilliseconds member of the SYSTEMTIME structure is the same. Since the GetSystemTimeAsFileTime() function does not need granularitry beyond milliseconds, the extra value can be ignored.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is that considered good or bad?
I just read a paper by Bjarne, where he used
Vector::Vector(int i) : sz(i), v(new int[i]) { } which I never do myself.
If heap allocation is needed, then I initialize the pointer with NULL in the member initialization list (MIL) and allocate the memory with new in the ctor body. But if you're using standard compliant tools that throws correctly if new fails, then it's perhaps OK to do it in the MIL.
Any thoughts on this?
--
The Blog: Bits and Pieces
|
|
|
|
|
i write a global CBT_HOOK function in a win32 DLL ,and i want to send a message to the DLL's calling windows.But it doesnt work. Here is my code:
HWND hCallWnd = NULL;
LRESULT CALLBACK CbtProc(int nCode,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch(nCode)<br />
{<br />
case HCBT_CREATEWND: SendMessage(hCallWnd,MyMsgID,0,0);
break;<br />
}<br />
return CallNextProc(nCode,...);<br />
}<br />
void InstallHook(HWND hcallwnd)<br />
{<br />
SetWindowsHookEx(WH_CBT,CbtProc,DllHandle,0);
hCallWnd = hcallwnd;
}
the Error is : in InstallHook() function,the hCallWnd's value is correct. But in CALLBACK CbtProc() function, the hCallWnd's value is always ZERO! so my SendMessage() doesnt work at all.
Who can point out reason ?
|
|
|
|
|
The DLL is loaded into the address space of each process and each process gets a separate copy of the global variable. You need to put hCallWnd into a shared partition.
See this article[^].
|
|
|
|
|
Is there any function to know that the current logon user is Administrator or Limited user?
Jesa
|
|
|
|
|
Hi
I think this will help you...Buffer in this function will be having all informatin that you want...
1. NetUserGetInfo()
2. GetUserName (Win API)
"Most of the failures in their life are the people are those who don't how near they were from the solution"
- Mahesh Amarelia
Gujarat
India
|
|
|
|
|
I survey the MSDN for the two function,
I think the problem will be solved by the two function.
But I need more time to realize the usage for the two function.
Anyway, you really help me a lot! Thanks
Jesa
|
|
|
|
|
Years ago I had the same problem, how to know user has admin rights if admin's user name is e.g "john" or if the user name is admin, does s/he really have those privileges ? I solved the problem by opening ServiceControlManager's database requesting SC_MANAGER_ALL_ACCESS rights. If it won't open, user is not an admin, if it opens user is really an admin.
I don't know how correct way this is to solve the problem, but it worked fine, and I think it is also rather simple way to detectuser's admin-level rights.
BOOL XYZ::IsUserAdmin(){
SC_HANDLE hSC;
ENUM_SERVICE_STATUS enumsstat;
hSC=::OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
if(hSC==NULL){
DWORD dwErr;
dwErr=GetLastError();
char szMsg[300]="";
switch(dwErr){
case ERROR_ACCESS_DENIED:
return FALSE;
break;
case ERROR_DATABASE_DOES_NOT_EXIST:
wsprintf(szMsg,"ServiceControlManager Database doesn't exist");
break;
case ERROR_INVALID_PARAMETER:
wsprintf(szMsg,"Invalid parameter while executing OpenSCManager()");
break;
default:
wsprintf(szMsg,"Error when executing OpenSCManager(), Error code is %ld",(long) dwErr);
break;
}
AfxMessageBox(szMsg);
return FALSE;
}
::CloseServiceHandle(hSC);
return TRUE;
}
|
|
|
|
|
Thanks for your answer!
This way works fine
Jesa
|
|
|
|
|
hi all!!
i want to develop an application which first checks whether the user is Administrator or any other user.
If the user is not administrator, i want to find the name of the user
how do i proceed?
|
|
|
|
|
1. GetUserName (Win API)
2. Env Variable USERNAME
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
i tried to search gamma value for printer, but i only found one for CRT, NTSC, PAL and stuff, not printer.
and i guess win32 api has "Getting printer's gamma correction factor" func or something similar...
does anyone know?
thanks in advance~
|
|
|
|
|
HI,
How can i read n write uing parallel Port
can any body tell me. with sample plz
thanx
Regards.
|
|
|
|
|
There are numerous examples here on Code Project about the programming of serial and/or parellel port.
Here's one of them, showing you how to control LED's with parellel port. The article is written by Jaygiri. The article[^].
Read the article through, and you will understand more of how the parellel port works. For even more detailed information, see this article[^]. It's written for C#, but the technical reference at the start is essential.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
thay all show how to write data there ,
but i also read data from there send by device
tll me abut read
thanx
Regards.
|
|
|
|
|
First, point your browser to this location: http://www.logix4u.net/inpout32.htm
In there, download the Inpout32 binaries and sources. From this zipfile, extract the files inpout32.dll and inpout32.lib. Place these into your project directory.
Open up your project, and go to project settings. Link with "inpout32.lib" to gain access to two functions: Inp32 and Out32 . You also need the definitions of the functions. They are as follows (add them to the start of the code module where you wish to use them, or create a header file):
extern short _stdcall Inp32(short PortAddress);
extern void _stdcall Out32(short PortAddress, short data); Now, use the articles' instructions to determine the address of your computer's parellel port. Then use the Inp32 function to read from this address. The returned value is a short integer.
If you need to determine if a certain pin on the port is set to logic-1 (high), use the articles' instructions, or Google for 'binary operations'. The idea is to mask the returned value against a certain value. The result of the mask operation is either TRUE or FALSE, depending if the pin is set or not. There are so many examples of masking operations on the Net that I don't want to repeat them here.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i got it ,,
i have little confusion now.
I m writing data on 0x378 address (data register)that goes to attached device
can i read data from it ,, mean to say that my
device can write data on data register pin that i want to register.
or it should write on status pins (10-15)
or only pins 2 to 9 can do both read and write
thax
Regards.
|
|
|
|