|
Acually my motive is to create grayed image......from colored jpeg to grayed image.
I searched and I found "Setting JPEG Compression Level".
Can I also use same for color settings.
Am I on correct way?
|
|
|
|
|
I want to draw an arc in open gl implented in visualc++ console application but i donot find any function to draw an arc and join the two arcs.Can any one tell me how to do this???
|
|
|
|
|
See this discussion[^].
Did you already set-up OpenGL correctly ? Because if you are new to OpenGL, I suggest you start with the basis.
|
|
|
|
|
Problem with Activex control property pages. when any of the properties are changed and next property page is clicked using tabs and oncancel button is clicked of the property sheet the properties are saved.
When property page is changed onapply is getting called automatically and DoDataExchange function is gets called and properties gets updated even after oncancel button.
Inorder to avaoi this wht needs to be done.
sreenivas003@yahoo.co.in
|
|
|
|
|
Hello everybody,
I like to draw a small border inside my CEdit. To "highlight" it.
I use already OnEraseBgnd to fill the entire CEdit in another color.
But in OnEraseBgnd I can't draw a small border, because the entire Background will be redrawn.
If I handle OnPaint(), it works, but in this case, I need to redraw the entire control myself (text, background, etc ...)
Is there a function-call to draw the standard-appearance, and after it, I start to draw myself on it?
I tested already to call the Parent OnPaint() ( CEdit::OnPaint() ) but this won't work.
Big thanks for any idea or basic instruction
Greetings
|
|
|
|
|
baerten wrote: I tested already to call the Parent OnPaint() ( CEdit::OnPaint() ) but this won't work.
-elaborate this a bit, please.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
Thanks for your post.
OnPaint is called in my control to paint/draw on the control.
If I don't handle the WM_PAINT Message, the initial Drawing-Functions are called and the control is
correctly drawn.
If I handle this Message, the control is blank, no drawings on it. I need to draw all myself.
I want to call a function into OnPaint to draw the initial/standard drawings (Background, Text, ...)
and after this, I make some small paintings on it.
Because I don't want to draw the entire CEdit by myself to simply draw 4 lines on it (an extra border in red)
I hope I could explain it better
Thanks
|
|
|
|
|
I'm not sure i completely understand but why don't you just let OnPaint do it's job and afterwards draw your border? E.g. like this:
CMyGreatEdit::OnPaint()
{
__super::OnPaint();
CDC *dc = GetDC();
ReleaseDC(dc);
}
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
hi friends,
i develop one protocol in MFC...i am using CSocket. main thread is Listen Thread..its ok fine.. in this thread all the client Handler stored in map..another two subthreads is Requestthread and Reponsethread..
Reponse thread sending Data to clients.. and Requestthread want recieve acknowledgement...
i want send and recieve Continuesly existing clients....
i am facing problem childthreads...please any body...ugrent..
|
|
|
|
|
Member 3653751 wrote: i am facing problem childthreads...please any body...ugrent..
Perhaps you could tell us exactly what problem you are facing, we cannot guess.
It's time for a new signature.
|
|
|
|
|
hi friend,
After sending i want wait for acknowledgement(RecieveThread).
Sendthread and recievethread individual Threads...
Example:
1. 10 clients connected to my Communicator....
2. I want to take associated client information(packets) from database i.e 10 or 100 packets
i want sent proper client and wait for acknowledgment.
After receiving acknowledgment i want sent another packet to corresponding client.
3. i want to all the clients like this...
note : Socket Handler stored in Map<clientid,sockethandler>;
UINT RecieveThread(LPVOID pParam)
{
AfxSocketInit();
CSolusServerDlg *Dlg= (CSolusServerDlg*)pParam;
bool bRun = true;
SOCKET * pCurrentHandle;
CSocket pSocket;
char pBuf[4096];
CWinThread * pCurrentThread;
pCurrentThread = AfxGetThread();
pCurrentHandle = &hClinetHandle;
pSocket.Attach(hClinetHandle);
for(int i=0;i<4096;i++)
pBuf[i] = '\0';
int len;
while(bRun)
{
if(pSocket.Receive(pBuf,4096)>0)
{
len = sizeof(pBuf);
for( int i=0; i<len; i++ )
Dlg->ActionScanReceivedByte(pBuf[i]);
}
}
CliThreadList.RemoveAt(CliThreadList.Find(pCurrentThread));
pSocket.ShutDown(2);
pSocket.Close();
CliHandleList.RemoveAt(CliHandleList.Find(pCurrentHandle));
return 0;
}
UINT Sendthread(LPVOID pParam)
{
AfxSocketInit();
CSolusServerDlg *Dlg= (CSolusServerDlg*)pParam;
bool bRun = true;
SOCKET * pCurrentHandle;
CSocket pSocket;
char pBuf[4096];
CWinThread * pCurrentThread;
pCurrentThread = AfxGetThread();
pCurrentHandle = &hClinetHandle;
pSocket.Attach(hClinetHandle);
vecUploadValues AcfManagementData;
for(int i=0;i<4096;i++)
pBuf[i] = '\0';
int len;
FILE *fpUpload;
char date [10];
char time [15];
SYSTEMTIME st;
char* CStrTrim = new char[1024];
unsigned char *l_uca_Buffer;
unsigned char l_uca_ActualData[1024];
unsigned char l_uca_Buffer1[2048];
unsigned char *cConverationBuffer;
CString strTemp;
char cstrTemp[512];
CDBFile objDB;
CSocket *pSocketSent;
while(bRun)
{
for(IteratorMap = mapControllerHandler.begin(); IteratorMap != mapControllerHandler.end() ;IteratorMap++)
{
char strControllerID[10];
char strControllerIID[10];
int ControllerId = (*IteratorMap).first;
sprintf(strControllerID,"%06d ", ControllerId);
memset(strControllerIID,0,sizeof(strControllerIID));
objDB.GetControllerID(strControllerID,strControllerIID);
objDB.GetData(strControllerIID);
AcfManagementData = objDB.GetUploadValues();
pSocketSent = (*IteratorMap).second;
for(int i =0; i < AcfManagementData.size(); i++)
{
fpUpload = fopen("..\\LogFiles/ControllerLogFile.txt","a");
strTemp = AcfManagementData[i].cUploadValueString;
m_gobjDB->SetCommandData(AcfManagementData[i].cVActionValueString);
strcpy(cstrTemp,strTemp);
int len = strlen(cstrTemp);
l_uca_Buffer = (unsigned char*)cstrTemp;
memset( l_uca_ActualData, 0, sizeof( l_uca_ActualData) );
int unsigned iplen = StringtoCSV(l_uca_Buffer,len ,l_uca_ActualData);
(*IteratorMap).second->Send(l_uca_ActualData, iplen, 0 );
GetSystemTime(&st);
sprintf(date,"%d/%d/%d",st.wDay,st.wMonth,st.wYear);
sprintf(time,"%d:%d:%d:%d",st.wHour,st.wMinute,st.wSecond,st.wMilliseconds);
cConverationBuffer = CSVtoString(l_uca_ActualData,iplen);
fprintf(fpUpload,"%s %s| Sent | <%s>\n", date,time,cConverationBuffer);
fclose(fpUpload);
Sleep(1000);
}
}
}
CliThreadList.RemoveAt(CliThreadList.Find(pCurrentThread));
pSocket.ShutDown(2);
pSocket.Close();
CliHandleList.RemoveAt(CliHandleList.Find(pCurrentHandle));
return 0;
}
please help anybody...
|
|
|
|
|
Member 3653751 wrote: please help anybody...
Well you have still not explained what is not working, or giving incorrect results. Also would you please edit the above message and put <pre></pre> tags around your code so it is properly readable.
It's time for a new signature.
|
|
|
|
|
... Stay tuned... Now booting Mystical Powers...
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
[My articles]
|
|
|
|
|
|
He has to use mystical powers, because you didn't include any information about your problem.
But you replied with more information to Richard.
Please read the "How to ask questions" post at the top of the forum for more instructions on how to ask a good question.
A good question will get better replies.
Good luck with your problems,
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Member 3653751 wrote: i want send and recieve Continuesly
So then shouldn't you be using CAsyncSocket instead? See here for more.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Can someone tell me how to track "rename sheet" event in Excel ? Is there any event gets called when we
rename some sheet in Excel ?
I couldn't find any ..please help
|
|
|
|
|
Dear sir,
I want to retrieve the value of Registers of operating systems by using C language.
|
|
|
|
|
Hi,
The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all.
Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context?
Cheers,
Ash
|
|
|
|
|
Hi!
Thanks for giving interest in my problem.
Acctually I have an pripherial device(MS-DOS) based;I want to retrieve their SerialNumber or any internal information.
Ex. We can retrieve the Motherboard number by using getipaddress();
|
|
|
|
|
I m sorry;Getipaddress is used for IP Address;also we can retrieve the Motherboard number.
|
|
|
|
|
I like to clear my problem with explanation.
EX:If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB.
If u have any idea plz tell me.
|
|
|
|
|
Ah, okay.
Despite working for a harddisk manufacturer I've never dug around in USB. If you're using Windows then http://www.emmet-gray.com/Articles/USB_SerialNumbers.htm[^] seems to have all the recipes you'd need to grab the serial number from a USB 2.0 device. One problem is that the code is written in VB, but it gives the sequence of Win32 calls you'd need to make to get the information (and it's a bit convoluted - hopefully someone more in the know can point you at a simpler method).
If you're using another OS then there's probably a similar recipe out there somewhere.
Another alternative would be to write a device driver and tickle the device directly through it's I/O ports and see how it giggles. However you'll need to know more than most mortals should need to know about USB - and having seen a colleague of mine go bald reading the OHCI, UHCI and EHCI specs I wouldn't wish that on anyone.
Cheers,
Ash
PS: Perhaps posting another question with "Reading configuration data (e.g. serial number) from a USB device" might attract someone who knows what they're talking about.
|
|
|
|
|
Thanks for this response;
But actually have an other Electronics device Ms-DOS based, Please clerify how to retrieve the information any system which can communicate with Computer System.
|
|
|
|
|
I'm not sure what you mean by a device being MS-DOS based.
If you can expand that a bit I might be able to point you somewhere to help.
Cheers,
Ash
|
|
|
|