|
Does anyone have some code snippets, or a suitable URL, to assist me in watermarking my C++ (unmanaged) code ?
Programming from a spec is like walking on water ......
Its Easier once frozen
|
|
|
|
|
hmmm... to be precisely.. these kind of questions are not very popular here...
you can't just watermark "C++ code"... you have to watermark the whole exe/dll/sys/etc file.
Don't try it, just do it!
|
|
|
|
|
The only time I've ever used the word "watermark" was in the context of an image within Word. How is it being used here?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
maybe he's talking about obfuscating his code ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I've seen enough of that without adding watermarks to the mix. Some folks just naturally write obfuscated code.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I want to receive characters from the serial com with 115200baud. In general my code works but
it has a small bug and I don't know why. Maybe someone can help me.
My problem is: Sending >820bytes by a commercial program to my code, my code receives just 820
bytes only. After the 820bytes WaitCommEvent() doen't recognize any incomming characters any more.
Here is my code:
================
* Open com port:
m_hPort = CreateFile(sFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);<br />
<br />
m_DCB.DCBlength = sizeof(DCB);<br />
GetCommState(m_hPort, &m_DCB);<br />
<br />
m_DCB.BaudRate = m_stCalibration.BaudRate;<br />
m_DCB.ByteSize = m_stCalibration.ByteSize;<br />
m_DCB.Parity = m_stCalibration.Parity;<br />
m_DCB.StopBits = m_stCalibration.StopBits;<br />
m_DCB.fDtrControl = DTR_CONTROL_DISABLE;<br />
m_DCB.fRtsControl = RTS_CONTROL_DISABLE;<br />
SetCommState(m_hPort, &m_DCB);<br />
SetCommMask(m_hPort, EV_CTS | EV_DSR | EV_ERR | EV_RXCHAR | EV_TXEMPTY);<br />
<br />
m_pListenerThread = AfxBeginThread(listener, this, THREAD_PRIORITY_HIGHEST, 0, CREATE_SUSPENDED, NULL);<br />
<br />
m_pListenerThread->m_bAutoDelete = FALSE;<br />
m_pListenerThread->ResumeThread();
* Read thread function:
listener (void)<br />
{<br />
DWORD dwBytesRead;<br />
DWORD dwBytesWritten;<br />
DWORD dwEventMask;<br />
BYTE szBuffer[MSGFRAME_MAX_LEN];<br />
DWORD dwOverlappedResult;<br />
DWORD dwLastError;<br />
BOOL bResult;<br />
DWORD dwDontCare;<br />
<br />
memset(szBuffer, 0, MSGFRAME_MAX_LEN);<br />
<br />
SetCommMask(m_hPort, EV_RXCHAR);<br />
WaitCommEvent(m_hPort, &dwEventMask, &m_stReadOver);<br />
while(1)<br />
{<br />
if(WaitForSingleObject(m_stReadOver.hEvent, 1000) == WAIT_TIMEOUT)<br />
{<br />
checkCalibration();<br />
continue;<br />
}<br />
<br />
dwOverlappedResult = GetOverlappedResult(m_hPort, &m_stReadOver, &dwDontCare, FALSE);<br />
if (dwOverlappedResult != FALSE)<br />
{<br />
bResult = ReadFile(m_hPort, szBuffer, 1, &dwBytesRead, &m_stReadOver);<br />
if(bResult != FALSE && dwBytesRead == 1)<br />
{<br />
m_stRingBuffer.RingBuffer[m_stRingBuffer.dwEnd].yChar = *szBuffer;<br />
m_stRingBuffer.dwEnd = m_stRingBuffer.RingBuffer[m_stRingBuffer.dwEnd].dwNext;<br />
m_pRingBufferFilled->SetEvent();<br />
<br />
}<br />
else if (bResult == FALSE && GetLastError() != ERROR_IO_PENDING)<br />
{<br />
}<br />
<br />
ResetEvent(m_stReadOver.hEvent);<br />
WaitCommEvent(m_hPort, &dwEventMask, &m_stReadOver);<br />
}<br />
}<br />
return;<br />
}
Thanks in advance )
Michael
|
|
|
|
|
Hi,
How to get the target file for a particular shortcut icon. This SHGetShortcutTarget API is only for CE OS. Is it possible to get the target for other OS.
Thanks is Advance
Baskar
|
|
|
|
|
Check out IShellLink::GetPath() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am working in windows programming, in that I cant use this method (IShellLink::GetPath()). Is there any API to find out.
Baskar
|
|
|
|
|
IShellLink is an (AP) interface. Why is it that you think it cannot be used? Here are a few examples of how it can be used:
http://www.codeproject.com/shell/CShortcut.asp
http://www.codeproject.com/shell/UtilShortcuts.asp
http://www.codeproject.com/shell/create_shortcut.asp
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i have 3 arrays red[288][352], green[288][352], and blue[288][352]. How do i display this image it in a window in a simple manner. thanks.
|
|
|
|
|
use this little code
CCleintDC dc(this);
COLORREF ref;
int i=0;j=0;
for(;i<288;i++)
for(j=0;j<352;j++)
{
ref=RGB(red[i][j],green[i][j],bluew[i][j]);
dc.SetPixel(i,j,ref);
}
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Can I declare a global variable in a DLL?
My variable is a object of Internal class that NOT exported.
Also my global object will use internally.
My dll is a "Regular DLL with MFC statically linked".
Does it cause a problem?
|
|
|
|
|
Behzad Ebrahimi wrote:
Can I declare a global variable in a DLL?
Yes.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
But How Mr David
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
The same way you would in an EXE. If the variable is not within the scope of a function, it has file scope, thus it is global. If you want to use the variable in a different file from which it is declared, you'll need to extern it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
how can I force WinXP to set the TCP/IP push bit when sending data on a socket that I created.
Rudolf
|
|
|
|
|
if you are using RAW_IP sockets, then yes.
Don't try it, just do it!
|
|
|
|
|
i have an odd run time error occuring my app. it is a simple SMTP program. when i select button1 it opens a CFiledialog as it should if i select "cancel" it works as it should no problems, but if i select "ok" the selected file path is returned as it should, however when the message is sent no data is written to the log file.
this occurs even if the path returned is removed before sending the data it follows the same code path as if i had not selected a path
the button code is as follows
void CMail2Dlg::OnButton1()
{
UpdateData(); // saves control data to variables
// Create an instance
CFileDialog fileDlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, "All Files (*.*)|*.*||", this);
// Initializes m_ofn structure
fileDlg.m_ofn.lpstrTitle = "Attach File";
// Call DoModal
if ( fileDlg.DoModal() == IDOK) // seems to be the cause of the problem!!!!
{
CString szlstfile = fileDlg.GetPathName(); // This is your selected file name with path
m_att = szlstfile; //sets path to a variable of my main modal dialog
UpdateData(FALSE); //variables to controls
}
}
// the following code is writing of data to a file which occurs in various functions
ofstream logc ("logs.txt",ios::out | ios::app);
if (logc.is_open())
{
logc << rVal; // rVal is the data
logc.close();
}
please could any1 help
|
|
|
|
|
ChrisBidmead wrote:
i have an odd run time error...
And that error is??
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
there is no error message! the problem is that it just seems to ignore the output to the txt file
|
|
|
|
|
It does not appear that the CFileDialog code and the ofstream code are in any way related. True?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
the ofstream code is run weather or not the CFileDialog code is. so not they are not related
|
|
|
|
|
Ok, so are we looking at two separate issues here? I tried your ofstream code and it worked fine. I did not try the CFileDialog code but it looked correct.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have an application that was created using VC++ that does not restore when it is minimized on the Task Bar. Well, technically, it will restore if you right-click on it and select "Restore," but it does not restore if you just click on it. I suspect that it may be related to the fact that the app has no menu, but that isn't supported by any data. I haven't seen any mention of anyone with a similar problem, so I thought I'd ask here if anyone has encountered similar problems and if there are any solutions.
|
|
|
|