|
Hi all:
I'd like to avoid the reboot while installing the MSI package, I have some clues but they are not worked as expected.
MsiInstallProduct(szPath, _T("REBOOT=ReallySuppress"))
After executing the above line the system rebooted without any warning. How can I really suppress the reboot?
|
|
|
|
|
Problem solved
you have to add the "ACTION" property too
So, final statement will be
MsiInstallProduct(szPath, _T("ACTION=ADMIN REBOOT=ReallySuppress"))
|
|
|
|
|
When i run m program i got this erroe how to solve this
C:\myproject\wartz_new\wartz_newDlg.cpp(194) : error C2039: 'GetLineCount' : is not a member of 'CString'
This is the sample code
<br />
m_MainEdit=m_MainEdit+"<Session ID :>" + sessionid +"\n";<br />
UpdateData(FALSE);<br />
iLineCount=m_MainEdit.GetLineCount();<br />
m_EditCtrl.LineScroll(iLineCount);<br />
|
|
|
|
|
I don't know what you are trying to do but a CString object is 'just' a string. So, there is no information about line count.
|
|
|
|
|
yes because CEdit::GetLineCount
|
|
|
|
|
and i guess you need to CString::GetLength
iLineCount=m_MainEdit.GetLineCount();
iLineCount=m_MainEdit.GetLength();
|
|
|
|
|
|
You created a member variable not a member value!
An easy mistake since the menu items are next to each other.
Elaine
|
|
|
|
|
Dear All
I write a program to read data from parallel port.
This program is a monitoring program and should work 24 hour per day.
I use following major functions to create and have inter process communication in my project.
AfxBeginThread
SetEvent
WaitForSingleObject
But after a while, I find that the system becomes very slow and dont respond to user requests . (Mouse movement and keyboard typing become very slow)
After running the program I dont have this problem for 5 or 6 hours but after that the problem begins.
Please give me any information in this regards
Best Regards
Mahdi
|
|
|
|
|
It is difficult to say like that. It looks like you have a little memory leak somewhere and that it gets called over and over again. So, the effects appear only several hours later, when the memory usage has increased too much.
To check if this could be the problem, use the task manager to monitor your memory (not very precise but in this case, it will give you enough information to see if this is a memory leak or not).
|
|
|
|
|
|
In my opinion, you should assure that all of the Windows handles and objects are properly closed and do not produce resource leaks.
For instance, if you create many events, you should close them with CloseHandle. Your threads should end, so that the total number of threads, even suspended, must not grow indefinitely. If you allocate ojects with new, you have to delete them with delete, and so on. I think you should investigate with Windows Task Manager, or other tool, the evolution of your program.
I hope this helps.
|
|
|
|
|
|
hi
Iam creating one gaming project .The project contains Two static controls. When I click on static controls popupmenu will appear.But requirement is that selected fields in popup menu should be in own color .so please kindky help in my project.
-- modified at 2:47 Wednesday 6th September, 2006
#sanroop#
|
|
|
|
|
|
Hi
Iam very thankful to your reply,here i face the problem with selected fields.
They have with windows default color(blue), is there any possibility to change the default color blue.if there is posibility please kindly help in my project.
#sanroop#
|
|
|
|
|
oh did you see http://www.codeproject.com/menu/SidebarMenu.asp(second link) its not blue its red and gray
|
|
|
|
|
hi all,
i am having one problem with threading
i created one dialog based application whose work is to read the data from serial port and display it.so i created one thred for this work.
means now i got two threads one is application thread and other is serial communication thread which is created in OnInitDialog.
now everything is working i mean the thread got created it read some bytes
from port and now it wants to show the data so need to send this data to main
thread. so i am doing this with ::SendMessage() but it is giving access violation. i don't know why this is happening and currently i am not sending the data also i.e. buffer so please help me
below is code (stepwise)
1)In Oninitdialog
THREADPARAM *ptp = new THREADPARAM;
if(ptp)
{
memset(ptp->array,0,30);
strcpy(ptp->array,"Harshal");
ptp->appHandle = this->m_hWnd;
hSerialThread = CreateThread( NULL,
0,
(LPTHREAD_START_ROUTINE) SerialCommunication,
(LPVOID) NULL,
0,
&dwSerialThreadID);
}
2)Thread function
UINT SerialCommunication(LPVOID pParam)
{
int write_req=0;
THREADPARAM *ptp = (THREADPARAM *)pParam;
while(1)
{
if(write_req == 2)// send write request and read it
{
DWORD length=0;
DWORD dwRead=0;
if (WriteFile(hCom,
SEND_CMD, // pointer to data to write to file
NOOFBYTE, // number of bytes to write
&length, // pointer to number of bytes written
NULL) == 0)
{// write failed
write_req = 0;
continue;
}
// writefile succeeded issue readfile
char buffer[MAX_MESSAGE];
memset(buffer,0,MAX_MESSAGE);
if (!ReadFile(hCom, buffer, MAX_MESSAGE, &dwRead, NULL))
{
write_req = 0;
continue;
}
if(dwRead > 0)
{
//MessageBox(NULL,buffer,"Data with packet",MB_OK);
::SendMessage(ptp->appHandle,MY_SHOW_DATA,0,0);// error is here
}
write_req = 0;
}
else // only read from port and increment counter
{
DWORD dwRead=0;
char buffer[MAX_MESSAGE];
memset(buffer,0,MAX_MESSAGE);
if (!ReadFile(hCom, buffer, MAX_MESSAGE, &dwRead, NULL))
{
write_req++;
continue;
}
if(dwRead > 0)
{// you are in thread you need to send message to
// main application
//char a;
HWND hwnd = (HWND)AfxGetApp()->m_pMainWindow;
::SendMessage(ptp->appHandle,MY_SHOW_DATA,0,0);
//MessageBox(NULL,buffer,"Data without packet",MB_OK);
}
write_req++;
}
}
return 0;
}
3) Sent message function
LRESULT CReadDataDlg::OnShowDataMessage(UINT wParam, LONG lParam)
{
return 0;
}
4)the handle i am storing in appHandle is right or wrong?
Thanks and regards
Harshal
|
|
|
|
|
In my opinion, instead of
hSerialThread = CreateThread( ..., (LPVOID)NULL, ...);
you should try this:
hSerialThread = CreateThread( ..., (LPVOID)ptp, ...);
I hope it helps.
|
|
|
|
|
harsha_1234 wrote:
Thanks and regards
Scope Problem! you are not passing your PTP variable to Thread!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How to get the window size of a popup window(CHtmlView)?
|
|
|
|
|
Isn't GetWindowRect works!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi Guys,
Please suggest any API for getting the drive names in local system.
Thanks in Advance
Velayudhan
|
|
|
|
|
I've never tried it but you might want to take a look at the EnumServicesStatus API using the SERVICE_DRIVER flag.
Steve
|
|
|
|
|