|
How do you insert your items to listctrl?
|
|
|
|
|
If there isn't any frame in a html document,'elementFromPoint' would
work fine,but when the element is in a frame,'elementFromPoint' can not get it.
How can I get it in a frame?
Thanks!
3.141592653... Never Stop
|
|
|
|
|
I have to place many check box on a Tab Page ,
but the checkbox have no caption ,
When the user want to slect any check box by
using the Tab switch on the keyboard. The checkbox
is not highlighted as it has no caption and He is
not able to identify the check box is currently slected
Can any one tell he some method trough which ,a higlight
or say a colour change can be done to the check box.
Remember we are not using the mouse (only keyboard)
thanks in advance
-- modified at 0:45 Tuesday 7th November, 2006
Vikas Amin
EATON
PUNE
|
|
|
|
|
Why they dont have caption?
|
|
|
|
|
I have lots of check box to be placed
on a small property sheet ,
more over grooping is possible so insted
of individual name groups have been created
Vikas Amin
EATON
PUNE
|
|
|
|
|
First I have a suggestion if you dont have caption on checkboxs use of tooltip for them.For color my naswer is OwnerDraw I think you can find an example on codeproject for ownerdraw its three led (checkboxs).
|
|
|
|
|
Owner-drawing the checkbox would probably be the way to go. There are plenty of articles on codeproject to guide you in owner-drawing controls.
I never thought of the fact that the focus indication is missing when omitting the label. Interesting.
|
|
|
|
|
..coming to think of it, you could do your own bookkeeping of the focus in your dialog, and just draw the focus indication from your dialog class.
|
|
|
|
|
I just have a dreadful feeling that your UI is going to suck.
Can you suggest a list control with the checkbox style, so all your items will fit on the window AND they can have labels?
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
I am using this code to insert data in msaccess database,but rateher then saving the record it will save in database some otehr values:
like:
ID DateTimeStamp MarketNo Bid MarketName Ask MarketState
-858993459 0:00:00 0 -368934881474191.0324 -368934881474191.0324 -13108
-858993458 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108
-858993457 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108
-858993456 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108
-858993455 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108
How to solve this problem,I have made comment line before the database code by which i am getting this problem.
<br />
void CArielProjectVer2Dlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market,<br />
LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, <br />
LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) <br />
{<br />
SessID=SessionId;<br />
CurrentRequestId=RequestId;<br />
CString MarketSt,a,b,c,d;<br />
<br />
txtMarket = Market;<br />
<br />
a.Format("%d",MarketNo);<br />
b.Format("%c",BidDirection);<br />
c.Format("%c",AskDirection);<br />
d.Format("%d",MarketState);<br />
<br />
m_MainEdit=m_MainEdit + "<Price Change>" +" " + SessionId + "\t" + RequestId +"\t"+ a ; <br />
m_MainEdit=m_MainEdit + "\t"+ Market + "\t " + Bid + "\t " + b + " \t"+ Ask + "\t" +c +"\t "+ High + "\t";<br />
m_MainEdit=m_MainEdit + Low + "\t" + d + " "+ "\t" + Timestamp + "\r\n";<br />
<br />
UpdateData(FALSE);<br />
iLineCount=m_EditCtrl.GetLineCount();<br />
m_EditCtrl.LineScroll(iLineCount);<br />
<br />
<br />
m_TQuote.MoveLast();<br />
int nCount = m_TQuote.m_ID;<br />
nCount++;<br />
<br />
m_TQuote.m_ID = nCount;<br />
<br />
HRESULT hResult = m_TQuote.Insert();
if(FAILED(hResult))<br />
{<br />
AfxMessageBox(_T("Error inserting the record"));<br />
return;<br />
}<br />
-- modified at 22:44 Monday 6th November, 2006
|
|
|
|
|
Hi,
could any body help, i want several techniques to hide a string from
debugging for example i need to hide lpszString_Tag from memory
LPCSTR lpszString_Tag = "CODEPROJECT";
...
MessageBox(lpzTitle,lpszString_Tag,MB_OK);
...
thanks
---
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
I assume you want to obfuscate the string so that it's not visible when greping through the binary for strings? You can always use XOR.
#define XOR_KEY "%¤#\"¤%!¤12323%%3kjlkjlkl5j312l4j3#¤\"!\"#"
int main(int ac, char** av) {
LPCSTR szKey = XOR_KEY;
int k = 0;
int s = 0;
printf("int len = %d;\n", strlen(av[0]));
printf("char str[] = { ");
while(av[0][s]) {
printf("%d", av[0][s] ^ *szKey++);
if(!*szKey)
szKey = XOR_KEY;
}
printf("};\n");
} This small app will from the first given program argument, generate an encoded char array, and a length variable containing the length of the array. The output may for example be:
int len = 6;
char str[] = { 5, 122, 53, 21, 45, 139 }; In your app, include common.h, and put those variable declarations somewhere in your .cpp file. Then when you want to use the string, decode it using the XOR key again.
#include "common.h"
int len = 6;
char str[] = { 5, 122, 53, 21, 45, 139 };
...
LPCSTR newstr = new char[len + 1];
LPCSTR szKey = XOR_KEY;
for(int i = 0; i < len; ++i) {
newstr[i] = str[i] ^ *szKey++;
if(!*szKey)
szKey = XOR_KEY;
}
newstr[len] = 0;
At the end of this code, newstr will contain the string you passed as argument to the encoding application.
This encoding scheme works on the premise that: Charenc != Charorig ^ Key, and that Charorig = Charorig ^ Key ^ Key.
It won't help you against skilled crackers, but it will be a simple way to hide strings which you do not want to reveal for the casual "grepper".
--
Based on a True Story
|
|
|
|
|
I use CXR[^]. I have the encrypting as part of my Release mode build rules and it's a snap.
|
|
|
|
|
Thanks for help guys , I wished that these tips will be unknown by all crackers (Obviously for me ) , well ..this topic is opened and any other tricks will be welcome ...
---
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
Hello all,
I am writing a server application that uses CAsyncSocket to send data to a client application which also uses CAsyncSocket to receive the data. The behavior that I am seeing is...
-Server listens and accepts client connection (no issue here)
-Server sends some data to the client.
-Client gets OnReceive message then receives data (sometimes).
All is well except the client does not always get the data that is sent by the server.
If the client and server are both running on the same machine, no data is lost. However, if the server is running on one machine and the client on another, about every third send is not received by the client.
Also, the server is not receiving an OnSend message. It is my understanding from another post that the server should receive an OnSend message after sending to indicate it is ready for another send.
I appreciate any help I can get on these issues. Thanks in advance!
~Rebecca
|
|
|
|
|
realius222 wrote: Also, the server is not receiving an OnSend message. It is my understanding from another post that the server should receive an OnSend message after sending to indicate it is ready for another send.
You'll need to call AsyncSelect(FD_WRITE) on the socket for OnSend() to be called by the
framework. You would do this on the socket accepted with Accept(). You may want to use other
flags as well but you at least need FD_WRITE to get OnSend() notification.
realius222 wrote: All is well except the client does not always get the data that is sent by the server.
With TCP, you need to repeatedly call Receive() (or recv()) on the socket until you get the
number of bytes you are expecting. There's no guarantee that a successful call to Receive() will
return more than one byte. Of course, it usually does.
For example, if, in your OnReceive() handler, you call Receive() to receive 100 bytes and
Receive() returns 50, then you can return from OnReceive() and call Receive() again in the next
OnReceive() call for the remaining 50 bytes. Therefore, you'll need to keep track of how much
you've received and/or how much you are still waiting to receive until you've received what you're
expecting.
Hope that made sense
Mark
|
|
|
|
|
realius222 wrote: Also, the server is not receiving an OnSend message. It is my understanding from another post that the server should receive an OnSend message after sending to indicate it is ready for another send.
Meaning of OnSend notification is different. The OnSend comes once both after establishing a connection or when WSAAsyncSelect(,,,FD_WRITE) called, which signifies a socket is ready for sending operation. The status “readiness for writing” remains until buffer space becomes available and a send fails with WSAEWOULDBLOCK. When buffer becomes available Windows Sockets notifies an application again. In other words, an application can assume that sends are possible starting from the first OnSend Notification and lasting until a send returns WSAEWOULDBLOCK. Therefore, it’s possible application receive OnSend only once after connecting and may send data via socket any time, in case an outgoing data flow rate less then a network capability.
Regars,
ISerik
|
|
|
|
|
Using VC++ 2005 Pro, I created the shell of an MFC ActiveX control, then added one property with get/put methods. That compiled ok.
Then I wrote a simple MFC dialog application to test my ActiveX control. Added the control, and gave it a variable name. That all worked ok after some studying about how to accomplish that.
My question is, the *.cpp and *.h files that were added to the MFC project do not contain the set/put methods of the control All those two files contain are the controls constructors. VC++ 6.0 compiler would put all the control's properties and methods in those to files for me. So, with VC++ 2005 how am I supposed to call the property and methods ? The control has a type library, but I don't know how to use it. Will someone please point me to a thread of site that shows how to use ActiveX with this compiler?
Thanks.
[edit]I found out how to create an MFC clas based on the type library, but how to use it in a CDialog application? It should not be this difficult. [/edit]
|
|
|
|
|
Hi,
I am writing a dll exporting an funcion to send email. Now I got a problem. When my dll was called by another application, the groupwise login dialog will show up, when I click 'Cancel', that login dialog will be gone. However, when my dll was called again, this login dialog won't show up anymore and MAPILogon return SUCCESS_SUCCESS, lhSession is not null. I don't know what's wrong. Can any one tell?
Thanks in advance.
|
|
|
|
|
nobody knows?
|
|
|
|
|
Dear All,
I am trying to implement print preview feature in a view class. (by implementing onBeginPrinting, onPrint, onEndPrinting) by using my friend's printing methods which are written in C language(his methods are used to print to printer directly). However, The existing method uses all kinds of map mode like MM_TEXT, MM_LOMETRIC, or MM_ISOTROPIC rather than MM_ANISOTROPIC(which is used by print preview feature defaultly). My question is, do I have to convert these mapping modes in existing printing method to MM_ANISOTROPIC? Or there is a easier way to do this?
Thanks for your reply in advance
let's do programming!!
|
|
|
|
|
Dear All,
Sorry, One more thing to mention. If I choose deskPDF in print setup dialog, the result printed would be exactly the same as that printed to printer. I think deskPDF has this kind of functionality too. My followed question is, how does deskPDF do it? Through pipeline? Is it possbile to implement print preview in deskPDF's way? Thanks.
let's do programming!!
|
|
|
|
|
I am a long time VB and ASP developer, experienced in both 6.0 and .net. I have had considerable experience in designing COM dll's and .Net class libraries for use by other applications. I am now trying to modularize a complex Visual C++ application by building dll's that can be referenced by different calling applications. Because of the complexity of the code, the short turn aound time and the lack of .Net and COM experience by the other members of the team, this is being done by building a number of Win32 dll's that will then be "plugged into" the calling application.
Therefore, I am trying to implicitly link a dll to an executable project using Visual Studio .Net (2002) Visual C++ 7.0. According to Microsoft, the search path used by Windows with implicit linking is 1. the directory where the executable module for the current process is located, 2. the current Directory, 3. the Windows system directory, 4. the Windows directory, and 5. the directories listed in the Path environment variable.
The documentation for VS 2002 states the "show directories for Executable files" on the "VC++ Directories" property page, lists the directories that Visual Studio will search for executable files and that it corresponds to the PATH environment variable.
I used this property page to link successfully to the library files in the lib directory of the dll project and the header files in the include directory of that project. I used the same means to link to the dll files in the bin directory of that project and I keep getting the "This application has failed to start because yadadyada.dll was not found. Reinstalling the application may fix this problem." message. When I built this application on another machine with VS 2005, the project properties page under Configuration Properties\Debugging had an entry called "Evironment" whereby I could enter the relative path to the YadaYada\bin directory; (Set PATH="..\YadaYada\bin"). But I was not able to find any equivalent entry on the property pages in Visual Studio .Net (2002). I manually added the path to the dll to the machine's "PATH" environment variable but it made no difference. When I copied the dll to the project's folder however everything worked as designed.
In my opinion, it is not good practice to include dll's to third party applications directly in your project's directory, (although I know that .Net managed applications do that with referenced third party namespaces). I am also not comfortable with adding third party dll's directly to the system32 directory. I feel that the calling application should be able to refer to the dll in the third party application's own bin folder. I would appreciate some advice on how to make this happen in Visual C++ if possible.
Thank you in advance for your assistance.
E.R. Joell MCSD MCDBA
|
|
|
|
|
joeller wrote: In my opinion, it is not good practice to include dll's to third party applications directly in your project's directory, (although I know that .Net managed applications do that with referenced third party namespaces). I am also not comfortable with adding third party dll's directly to the system32 directory. I feel that the calling application should be able to refer to the dll in the third party application's own bin folder. I would appreciate some advice on how to make this happen in Visual C++ if possible.
Welcome to DLL hell. Even Microsoft calls it that.
Adding the path to the PATH environment variable is the way to do it but I believe you'll need a
full path, not a relative path. It doesn't work the same way as the path settings in the
Visual Studio environment, where paths are put together based on your project paths.
|
|
|
|
|
"Adding the path to the PATH environment variable is the way to do it but I believe you'll need a full path, not a relative path."
Quite right which is what I did. no joy.
|
|
|
|
|