|
Hi, thanks for replaying. I tried NC messages also but they are also not working. My doubt is that whether we can display tooltip for a region in a dialog or not.
Thanks
|
|
|
|
|
Am not completely sure but it should work since as far as i know the dialog, from the perspecfive of the tooltip is just a CWnd like any other... How did you create the region you specified for it, what coords did you use?
I think what you could do is to somehow calculate the border area's position in client coordinates and add these to the tooltip. Then, when WM_NCMOUSEMOVE comes in, convert the mouse coords to client coords of the window, and feed these to the tooltip with WM_MOUSEMOVE instead of WM_NCMOUSEMOVE. No idea if this would work or not, but it might be worth a try. So i mean something like this:
...
case WM_NCMOUSEMOVE:
{
CPoint Pt(lParam);
ScreenToClient(Pt);
MSG msg;
msg.hwnd = m_hWnd;
msg.message = WM_MOUSEMOVE;
msg.wParam = wParam;
msg.lParam = MAKELPARAM(Pt.x, Pt.y);
mLeftToolTip.RelayEvent(&msg);
}
...
[edit] Hey, i just tryed it out, you don't need all this fancypants "message converting" thing, if you feed the tooltip the coordinates of the borders in client-space then it will work flawlessly.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
modified on Wednesday, February 25, 2009 8:34 AM
|
|
|
|
|
Hi, Its working.
Thanks a lot.
|
|
|
|
|
I have a set of Files, used by my Applications as a Database. These files are accessed directly by my software, and are stored on one of the machines forming a 'Peer to Peer' Network.(16 Terminals Max). The End users are generally oblivious to the existence of these files. All Opening, Closing, Reading or Writing is done transparently, without the user being aware of this happening. In fact, the users are mostly not aware of the existence of File Systems.
Actually, The location of the Database should not be disclosed to anybody else but Registered Power Users.
All Terminals are logged in to the network as 'Administrator'
It is of course an imperative for the system that the 'File System' should be visible to All Users on the Local Network.
I Currently install the Database under:-
'c:\Program Files\MyCompany\AppName\Data'
Question:
What Directory should I select in my Setup Code to ensure a clean Setup in Vista.
Regards
Bram van Kampen
|
|
|
|
|
My application used to argument (with argv[1]: filename). How to get fullpath from filename via argv[1]. For example, [myapp.exe input.txt ].
|
|
|
|
|
What's wrong with
fullpath(argv[1]);
??
|
|
|
|
|
I'm assuming that you are passing in the argument so the caller would need to pass it in. Many windows functions look for the file name in the order of current directory then traverse the path. But if you need to get the entire file name that will have to be passed in.
If the file is in the current directory you can use findfirstfile findnextfile functions.
a programmer traped in a thugs body
|
|
|
|
|
If you want the fullpath relative to the current working folder you can use the _fullpath function as mentioned by W. Kleinschmit.
If you want to search for the file and then get the full path of that file you can use PathFindOnPath API.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi I got a project which involves interprocess communication. I uses pipes because it's only happend in one machine. It seems everything should be perfect. However, When I try to connect The Client and The Server. I always have an Error number 231 ( All pipe instances are busy) when I try to create file in client side.
Client --> Create File, Write File
Server --> Create Named Pipes, Read File
here is some of the code in my programs
m_hPipeHandle = INVALID_HANDLE_VALUE;
m_hPipeHandle = CreateFile(ISOCOMSPIPE,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if(m_hPipeHandle == INVALID_HANDLE_VALUE)
{
int iRet = GetLastError();
printf("Error number %d",iRet);
}
closeHandle(m_hPipeHandle);
Is there anything wrong in the attributes/ missing attributes when I want to create the file ?
Thx
|
|
|
|
|
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99331[^]
Can someone check to see if the above bug was fixed in VC++ 2008.
I've got some code that is based on the assumption that virtual properties works, i want to know if i have to modify the code or upgrade to 2008.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
You'll have to modify the code - that behaviour is still present in VS2008
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Based on their bug response i'm not too surprised.
Thanks for checking, i really didn't want to install VC 2008 Express just to check.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi all,
I have written a Javascript code that moves a dot around the screen randomly, and it does output my result at the end of the code, however I feel I have gone as far as I can with this code and would like a different way to create the program. First thought was using C++,
Here is the code:
<code> "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<style type="text/css">
body {
overflow:hidden;
}
#container div,#timer {
width:250px;
line-height:30px;
padding-left:10px;
border:3px double #999;
margin:4px 0;
}
.hide {
display:none;
}
#dot {
width20px;
font-size:36px;
color:#f00;
position:absolute;
}
#coords {
padding:10px;
border:3px double #999;
margin-top:10px;
font-family:courier,monospace;
font-size:12px;
text-align:justify;
}
</style>
<script type="text/javascript">
/****** these values may be edited *****/
var iterations=2000;
var height=999;
var width=999;
var temp1=500;
var temp2=500;
/***************************************/
var speed=10;
var c=0;
var ur=0;
var ul=0;
var dr=0;
var dl=0;
var s=0;
var xc=0;
var yc=0;
if(window.addEventListener){
window.addEventListener('load',randomtest,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',randomtest);
}
}
function randomtest(){
secs=Math.floor((iterations-c)*speed/1000);
x=Math.floor(Math.random()*width);
y=Math.floor(Math.random()*height);
document.getElementById('coords').innerHTML+=x+':'+y+', ';
document.getElementById('dot').style.left=x+'px';
document.getElementById('dot').style.top=y+'px';
if((x>=temp2)&&(y>=temp1)) {
ur++;
temp1=x;
temp2=y;
}
else {
if((x<=temp2)&&(y>=temp1)) {
ul++;
temp1=x;
temp2=y;
}
else {
if((x>=temp2)&&(y<=temp1)) {
dr++;
temp1=x;
temp2=y;
}
else {
if((x<=temp2)&&(y<=temp1)) {
dl++;
temp1=x;
temp2=y;
}
}
}
}
c++;
xc=xc+x;
yc=yc+y;
if(c>iterations) {
clearTimeout(rnd);
document.getElementById('timer').className='hide';
document.getElementById('dot').className='hide';
document.body.style.overflow='visible';
document.getElementById('upright').firstChild.nodeValue='up right total='+ur;
document.getElementById('upleft').firstChild.nodeValue='up left total='+ul;
document.getElementById('downright').firstChild.nodeValue='down right total='+dr;
document.getElementById('downleft').firstChild.nodeValue='down left total='+dl;
document.getElementById('container').className='';
document.getElementById('coords').className='';
alert('average coords are n\nx='+Math.round(xc/c)+'\ny='+Math.round(yc/c));
return;
}
document.getElementById('timer').firstChild.nodeValue='time remaining : '+secs+' seconds.';
rnd=setTimeout('randomtest()',speed);
}
</script>
</meta></meta></meta></head>
<body>
<div id="timer"> </div>
<div id="container" class="hide">
<div id="upright"> </div>
<div id="upleft"> </div>
<div id="downright"> </div>
<div id="downleft"> </div>
</div>
<div id="dot">•</div>
<div id="coords" class="hide"></div>
</body>
</html>
</code>
Can anyone help out with some C++ code to get me started? I would be forever greatful.
Skie
|
|
|
|
|
A thumbwheel switch (swt) has been assigned a 16 element array to determine which number is selected. How would I access that data?
When I try *swt, I recieved error messages and warnings. When I use swt[0-16], I get zeroes as the switch values.
|
|
|
|
|
Without actually seeing your code and if you are using
swt[0-16]
Then the actual index into the array is -16.
Larry J. Siddens
|
|
|
|
|
Original code looks like this:
if (local->decode)
{
swt[0] = 0;
swt[1] = 1;
swt[2] = 1;
swt[3] = 1;
up to [15]
}
locals->temp = 0;
for (mode_index = 0; mode_index < 16; mode_index++)
{
if (swt[mode_index] == 1)
{
locals->temp += (1 << mode_index);
}
}
====================================
What I am attempting to do looks like this where I tried *swt and swt[0], swt[1], swt[2], etc...:
nom3as = nim3as
if (nom3as == 0)
nom3ac = 0;
else
nom3as |= 0x00002000;
nom3ac = swt;
|
|
|
|
|
In your last line:
nom3ac = swt;
You're setting the variable nom3ac to the address of the start of the array (or the address of swt[0].)
Is this correct?
Larry J. Siddens
|
|
|
|
|
|
What about a good C language tutorial?
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]
|
|
|
|
|
You can use only integral expressions as the switch expression.
What type of array is it?
If it is a character array, you must use the string functions in the if statement.
If it is an integral array, you are storing multiple values. You must use the array subscript [] to specify which element to check.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I tried using [].
Will I have to use it for each element of the array?
|
|
|
|
|
Yes.
Say you have an array:
int p[] = { 5, 4, 3, 2, 1 };
then to get the 3rd element use:
int x = p[2];
This will set x to 3. Remember, arrays start at index 0 instead of 1.
To loop through
for( int 1 = 0; i < 5; i++ ) {
x = p[i];
}
Larry J. Siddens
|
|
|
|
|
Yes. You will have 16 array elements ranging from swt[0] to swt[15]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
my VC++ 6.0 application calls my check_user_sp stored procedure that calls the sys.sp_helpuser system stored procedure:
-----
CREATE PROCEDURE check_user_sp
@inp_user VARCHAR(20)
AS
EXEC sp_helpuser @inp_user
-----
I have no problem running the application against database on the 2000 sql server(2000 - 8.00.760), but I get 'Invalid character value for cast specification' error with the same database on the 2005 sql server(2005 - 9.00.1399.06).
the sp_helpuser is dated 1996/08/14 10:33 on both 2000 and 2005 server, and I don't get error when exec my get_user_sp in the 2005 sql server management studio.
what is 2005 sql server doing to cause this?
THANKING FOR YOUR HELP!
|
|
|
|
|
Hello!
try checking database collation settings / server collation settings.
|
|
|
|