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 created from R and S.
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.
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.
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.
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.
sorry confusing it.
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 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
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.
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.
I am using Visual Studio 8.
I created two win32 empty project and created C "Mylib.c" "MyWrapperlib.c" file to get static library Mylib.lib and MyWrapperlib.lib.
I created another win32 empty project and when i link the static library "MyWrapperlib.lib" (with Mylib.lib and MyWrapperlib.lib in library path) with simple C code "TestApp.C" with main(), it is working fine.
I have used windows.h in "Mylib.c" and "MyWrapperlib.c" for FILE operations.
I want to have a GUI application, so I created NewProject->CLR->Windows Forms Application (MyUIApp.Cpp). When i used MyWrapperlib.lib, it gave linking error.
so I created DLL for MyWrapperlib.c by using #define dllexport __declspec(dllexport)
enclosing with extern C
When i use MyWrapper.dll in MyUIApp.Cpp, it is giving below error
"fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B0"
Can some guide me how to create 'C' lib/dll and use it with GUI application.
I want to have a GUI application, so I created NewProject->CLR->Windows Forms Application (MyUIApp.Cpp).
Should have used MFC, then you'd have native code throughout, so you could have used your static library.
However - you can link C++/CLR modules against your static library (meaning you don't need the DLL). In your project proerties, change the "Common Language Runtime support" option to "Common Language Runtime Support (/clr). Worked for me, anyway.
In addition to Cedric's reply - the version of the Platform SDK that comes with VS2005 (Standard and above) will be from 2005 (when VS2005 was released). This means that it won't be able to access features that came with Vista. If you do want to access features from Vista, then you'll need to install a later version of the PDK.