|
See the example here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
|
See here and here and here and here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi
I have a lib Linker problem.
I built "nurbs" dll. This gives me a lib and a dll.
When I tried to link the lib and used " /FORCE:MULTIPLE". . I got a lot of warnings which look like:
warning LNK4006: "void __cdecl PLib::resizeKeepBasic2DArray<struct PLib::HPoint_nD<float,2> >(class PLib::Basic2DArray<struct PLib::HPoint_nD<float,2> > &,int,int)" (??$resizeKeepBasic2DArray@U?$HPoint_nD@M$01@PLib@@@PLib@@YAXAAV?$Basic2DArray@U?$HPoint_nD@M$01@PLib@@@0@HH@Z) already defined in drawtool.obj; second definition ignored.
How can get rid of warning and not using "/FORCE:MULTIPLE".
Best regards,
modified on Thursday, May 14, 2009 12:38 PM
|
|
|
|
|
That says to me that PLib::resizeKeepBasic2DArray is contained in a header and not marked as inline , so there are multiple definitions of the code. You need to either a) mark it as inline, or b) ensure it's only contained in one .cpp file.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi
You are great.
I have one more question for you.
How about the static data member? like "static T dumbVar ;" in the following:
template <>
struct HPoint_nD<double,2>
{
typedef double T;
T *data ;
int created; // usefull to change the data pointer
Point_nD<T,2> projectW() { return Point_nD<T,2>(x(),y()) ; }
protected:
static T dumbVar ;
};
|
|
|
|
|
transoft wrote: How about the static data member? like "static T dumbVar ;" in the following:
Needs to be defined in a cpp file somewhere. This code won't link, because Test<int>::y is missing.
template<class T>
class Test
{
public:
static int y;
};
template<>
class Test<int>
{
public:
static int y;
};
int main()
{
Test<int>::y = 120;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have four arrays as input, then used it in a function that result an output. Then I sorted the output array. Next step, I want to find the index and the value of the input array that resulted the sorted array. I keep getting the wrong result.
Here my (part of) code (forgive me for my poor codes;
for (i=0; i<size2; i++){
for (l=0;l<point3[i];l++){
for (a=0;a<b[i][l];a++){
gradient [i][l][a]=(S[i][l][a]-Cy[i][l])/(R[i][l][a]-Cx[i][l]);
}
for (a=0;a<b[i][l]-1;a++){
for (d=a+1;d<b[i][l];d++){
if (gradient[i][l][a]>=gradient[i][l][d]){
temp=gradient[i][l][a];
gradient[i][l][a]=gradient[i][l][d];
gradient[i][l][d]=temp;
}
}
}
}
}
for (i=0;i<size2;i++){
for (j=0;j<point3[i];j++){
for (k=0;k<b[i][j];k++){
for (l=0;l<b[i][j];l++){
if (fabs((S[i][j][l]-Cy[i][j])/(R[i][j][l]-Cx[i][j]))==gradient[i][j][k]){
}
}
}
}
}
The result I have is not for entire array, but just R[1][1][3] and S[1][1][3];
What should I do to fix it?
Thanks.
|
|
|
|
|
What about debugging?
Jaguks wrote: if (fabs((S[i][j][l]-Cy[i][j])/(R[i][j][l]-Cx[i][j]))==gradient[i][j][k]){
Why are you using fabs in the above line?
Are you aware that == operator on float (or double ) values is tricky (i.e. (f1==f2) should be replaced, usually, with (fabs(f1-f2)<eps) (where eps is a small quantity, problem-dependent)?
BTW: the fancy changes of the index names, in different blocks of code, are done to deceive the enemy?
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]
|
|
|
|
|
CPallini, Jaguks,
I find it difficult to believe that the hardware would calculate a different value for gradient in the first set of generation and sorting code than it calculated in the second set of checking code. The values are not retained in the FPU as temporary real values, but are saved in variables and then sorted. The truncation indicators would not be changed either, so the checking gradient should match the creation gradient, no matter where it appeared in the array.
Having all of the associated code and declarations would help. The //printf must really be just printf, otherwise nothing would be output.
One possibility that would cause this limited output is that the swap variable is of a different type than the actual variables (float vs double) and the swapped variables are truncated during swapping. This might cause the second calculation of gradient to be a double, but it would not match the swapped first generation variable which was truncated to a float, then propagated back to a double. Cannot determine this without the full code and/or declarations.
Dave.
|
|
|
|
|
Jaguks,
Sorry for the double post, but I figured out what went wrong.
The second block of code is just reporting which gradient elements are in their original positions (as created). Only one remains in the same place, gradient[1][1][3] created from R[1][1][3] and S[1][1][3].
To do what you want to do (report the initial creating index values) you must save the creating index values along with the gradient value, either in a structure containing all four of the items (an array of structures instead of an array of gradient values), or else in a separate array of structures (each structure containing the index values) that is built along with building the gradient value array. When swapping the gradient values, you must also swap the index values structures if they are a separate array, or else swap the four element structure instead of just the gradient value if they are in a combined stricture.
The reporting code block can then eliminate the test and then just report the gradient and its associated generating index values, and the R and S values. The generating index values would come from either from the combined 4 element array of structures, or from using both the gradient array and the index values array of structures. In the new report, i,j,l would be used only to select the gradient value and its associated saved index values, the saved index values would be used to select the R and S values for reporting, and for reporting the i,j,l values.
In general, you must save the index values with each created value to be sorted in order to be able to report which index created any sorted value.
Dave.
modified on Friday, May 15, 2009 10:52 AM
|
|
|
|
|
Hi,
I have an app in my system tray. On a special key press, would it be possible to change system cursor to a custom one without having it changed regardless what other applications under the cursor might want to change it to? For instance, when holding down CTRL+ALT, my new cursor shows but it is quickly overriden by Internet Explorer because now I'm pointing on a url link (forcing the cursor to become a pointing hand).
Disregard the fact that doing this - if at all technically possible - is not recommended for issues of interference and weird and unexpected behavior.
Thx!
/T
|
|
|
|
|
Tommy Svensson wrote: would it be possible to change system cursor to a custom one
Well, I haven't tried it exactly; let me share some ideas or workarounds.
You can change the system cursors to a custom one using either one of the following or in a combination of two.
1. SystemParametersInfo : Retrieves or sets the value of one of the system-wide parameters. This function can also update the user profile while setting a parameter.
2. SetSystemCursor : Enables an application to customize the system cursors. It replaces the contents of the system cursor specified by the id parameter with the contents of the cursor specified by the hcur parameter and then destroys hcur.
I will recommend the 1'st one to try out, beacuse by using this API you can do anything that you done to change the Desktop settings manually. Use the SPI_SETCURSORS parameter for changing cursor.
You may get some ideas from
1. http://www.thebitguru.com/articles/14-Programmatically%20Changing%20Windows%20Mouse%20Cursors[^]
2.http://msdn.microsoft.com/en-us/library/ms724947.aspx[^]
3.How to programatically disable/enable screen savers/power management[^]
*4. The google codesearch[^] result
|
|
|
|
|
\ i don't know how to show the widget like in ide status.
|
|
|
|
|
what is the question ?
Adding "stuff" in the Status Bar ? see Illustrates Custom Control Bars[^]
Moving "Widgets" around ? You need to do this manually or use some of the many layout managers; If the "widgets" are in the
status bar, you are lucky, they should be moved automatically when the window is resized.
This signature was proudly tested on animals.
|
|
|
|
|
sorry confusing it.
for example:
i want to show a button in my windows form on runtime, and its style is like the edit status when you create application resource in VS ide window, can resize, rename caption, modify its property.
|
|
|
|
|
i found a sample code, named "designerhost", but it was achieved by C#.
|
|
|
|
|
Hi,
How do I load an existing image (icon or bitmap, whichever is possible) to an existing ToolBar without actually having to draw it?
Thanks
sft
|
|
|
|
|
why ?
You could try to get the CListImage (CToolBarCtrl::GetImageList) attached to the toolbar, grow it and insert a new image into that.
This signature was proudly tested on animals.
|
|
|
|
|
sir
i am making on a banking project which is based on desktop application
in which we want to provide passward to each customer
but how wiil we provide passward to customer so that when user enter the passward
then employee unable to see that passward
and after entering the passward the bank teller can see the hole informatin about the bank
sir i am working with c as a front and file system for data storage
|
|
|
|
|
If using a CEdit control, you can use the ES_PASSWORD style and the typed characters will be shown as astricks.
[edit]
Please disregard post for the reason below. Thanks for pointing that out David.
lalit kumar jayswal wrote: working with c
[/edit]
modified on Thursday, May 14, 2009 10:53 AM
|
|
|
|
|
jeron1 wrote: If using a CEdit control...
Does that work in C?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
If you are using something like getch() to get user input, just echo some other character back to the screen.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi again,
I am trying to find a way to spawn a process that will continue running once I log off.
A previous post ended up giving me a solution : services. I tried this out, and it solves
the problem as it was stated - the service continues to run when I log off.
However, I need Admin privileges to start / stop the service - which is not exactly the type of privileges my customers have.
Any ideas ?
Thanks
Andy
|
|
|
|
|
andypandy2 wrote: which is not exactly the type of privileges my customers have.
Hi again Andy,
The last two parameters of CreateService[^] gives you provision to set a user name and password. But I am not sure at what happens when you logoff the same user.
The doc says,
pServiceStartName [in, optional]
The name of the account under which the service should run. If the service type is SERVICE_WIN32_OWN_PROCESS, use an account name in the form DomainName\UserName. The service process will be logged on as this user. If the account belongs to the built-in domain, you can specify .\UserName.
pPassword [in, optional]
The password to the account name specified by the lpServiceStartName parameter. Specify an empty string if the account has no password or if the service runs in the LocalService, NetworkService, or LocalSystem account. For more information, see Service Record List.
|
|
|
|