|
Harold (above) is correct, these are Unix commands, so unless you are compiling in a UNIX system they will not be recognised. What exactly does the SQL book say about this?
|
|
|
|
|
Ishaan Karnik wrote: execl sql include sqlca; execl sql insert into Table1 values(number,",'",fname,"','",lname,"'");
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
Dear friends...
I have some clarification on C++ basic
1. "Unsigned variable” this line is accepted in C++ With out specifying any data type like "unsigned int var" or "unsigned short var", how this will allocate memory space?
2. Here is my code ( i am using Visual C++ 6.0)
String mystring ="";
getline (cin, mystring);
cout <<mystring <<="" endl;
this="" getline="" method="" expects="" 2="" "enter"="" button="" actions="" why?
3.="" and="" the="" other="" clarification="" is=""
="" cin="">>mystring;
cout <
|
|
|
|
|
1. unsigned int will take the same amount of space as a signed integer; likewise unsigned short.
2. On my system the getline() call requires only one <Enter> key.
3. cin reads into 'mystring' until it sees a space. The remainder of the line is read in by the getline() call which, by default, reads until it sees the line delimiter.
See the string::getline[^] page in MSDN for further information.
|
|
|
|
|
1. Because C standard establishes the equivalence between 'unsigned ' and 'unsigned int '. See the "ISO/IEC 9899" standard, available as PDF here [^], check out page 100 .
2. Because you can get a line only when it is (newline) terminated.
3. That's wrong: the two statements
cin >> mystring;
and
getline(cin, mystring);
are equivalent.
3. Because space is one of the string terminators for the >> operator.
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]
modified on Saturday, December 19, 2009 9:15 AM
|
|
|
|
|
I have a program which generates GUID.Is there a chance that more than one thread spawned at the same time (< 1 millisec) in the same machine to have same GUID?.
Thanks,
Rane
|
|
|
|
|
There is no chance, unless GUID generation mechanism is broken, I guess.
Why don't you make a little test?
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]
|
|
|
|
|
Rane wrote: I have a program which generates GUID.Is there a chance that more than one thread spawned at the same time (< 1 millisec) in the same machine to have same GUID?.
I don't think so. The GUIDs will be different.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I'm writing a MFC MDI app. which can interactively apply certain processes on an image. I'm trying to have a menu option that will make a copy of the current image so you can get back to a previous image state, or compare different processes on the same image. Of course, this can be done by saving the image to disk with a new name and loading it back, but it would be nicer to just be able to make a temp. copy of it at any stage of processing.
I don't want a new view of the current doc. because then any changes to the doc. would be passed to both views. When I tried it from the doc. side it replaces the current doc. and I haven't gotten it working from the view side either.
Any help would be appreciated.
Thanks,
D
|
|
|
|
|
You don't specify how you are holding the image data in your program. However, assuming it is some set of records, all you need to do is create a new set and copy the data from the existing set into it. You can, of course, design a set that keeps track of individual changes but that is a little more complicated.
|
|
|
|
|
I'm using the CImage class, part of MFC that comes with Vis. Studio 2008. basically what I'm trying to do is get MFC to make a new document w/o opening a file up - just blank, then I can copy the image to it.
|
|
|
|
|
It's some while since I have used MFC, but these are all just C++ classes so you should be able to adapt the base class to your own requirements. You can override the OnNewDocument() member function, or (I think) you can use the CDocument() constructor to create a new one.
|
|
|
|
|
Well,
you work with a document and a view. Let's say your document has a CBitmap and some other parameters to hold coordinates, colours and so on.
When you save to disc, you are probably using the serialize.
One way would be...
If you just want to have a copy of your data, without saving to a file, then the best option (if space and amount of data is not an issue) is doing a copy. For instance:
CBitmap_1 --> CBitmap_2
CPoint coordinates --> CPoint coordinates_2
and so on...
Of course, all classes you use must have a copy and assignment operators. If don't you won't be able to do what you want.
Another way would be...
Using the disc to hold a temp copy of your data, you can do it without calling the Save.. or Save as.. I mean, when you call the function you want to have the "Back" action, you make a parallel saving in disc, but the user don't get any prompt to give name or even notice it using the CFile and its set of functions.
For instance, I made a software to connect with a PLC and was able to read the actual values of a Step7 function, but to do that, the actual project in the software and the read function in the PLC must be equal. So I got a copy of the online function and made a translation of the project in the programm to compare them. The user didn't notice anything of that.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I don't want to have to use a temp. file if I can do it in memory. It can get messy keeping track of file cleanup. I've sort of gotten something working now using a call to m_pDocTemplate->OpenDocumentFile(NULL); This seems to call OnNewDocument() and it opens a new document and I can write the image to the new doc. but the window size isn't quite right.
Darryl
|
|
|
|
|
But, are you wanting to show the (let's say) "before" and "after" images at the same time? Or just have a copy of your original image to be able to go back to previous changes if you don't like the results of your edit?
If the first one, I would use 2 different views with a centralized document containing the 2 image sets.
If the second, just doing a copy of your CImage into a second one would be enough. You can continue working with the "main" image, but at the end of your method you can ask the user to go back to previous stand or to accept the new one. Going back then you overwrite the "main" with the copy, if continue with new one then just delete the copy.
If I didn't understand what you are asking for, please elaborate a bit more.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yeah, this is a multi-doc. interface where you can have many images open at same time so I just want to copy the CImage into another, but the question was how to do this in the MFC framework.
|
|
|
|
|
Multi-Doc is something like MS Word, you can have different documents opened at the same time, but each view has only one document associated. In other words, there are more pairs CView-CDoc.
I was asking if it was a single Doc with more than one View.
With this option, you could just make a copy of the image and open each copy in a different view, but both are connected to only one CDocument.
Is this what you want to achieve? (Other option was given in the messages above)
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I have a service running with the local system ("NT AUTHORITY\SYSTEM") credentials, and I have the name of the user (LPCTSTR). Now I need to start a process with that user's credentials, but I don't know that user's password ("NT AUTHORITY\SYSTEM" shouldn't need any passwords, right?). How can I do that? My biggest problem is getting the token.
LPCTSTR strUserName = "username";
HANDLE hToken = ???
use LogonUser
or DuplicateHandleEx
or ImpersonateLoggedOnUser
CreateProcessAsUser(hToken, ... );
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
If the system allows you to run a process in a user account without knowledge of the user's password, there is no point in having a password in the first place. That would be a security breach.
So you have to know the user's password in order to start a process in that user's context.
|
|
|
|
|
I thought NT AUTHORITY\SYSTEM was something like the root account in unix.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
There is one basic difference here.
You first login as root using its password and then you have access to other accounts.
If the System account acted in a way, here is one scenario of a security breach.
UserA creates a service that runs in the System account.
The service then runs a program as UserB without knowledge of the password.
This program then deletes or shares all sensitive data of UserB.
|
|
|
|
|
hello,
I m a new to software programing
so can u help me from star.....
Q1. Which programing language I learn first..or best for software development( Visual basic, C, C++....)
i have some knowledge of C.
I believe in Code Project< ....please help
thank U
|
|
|
|
|
There is no best computer language for software development.
Each language is suitable for specific types of applications.
By far C++ is language that can be used for almost all types of applications.
And since you already know a little C, I would recommend learning C++.
Get a good book like Learning C++ by Eric Nagler.
You will also get a lot of help from the internet.
|
|
|
|
|
There is no "best" programming language for software development. You use the right tool to finish the right job.
If you already have some knowledge in C, then you can proceed to learn C++. You might as well consider learning C#.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Thank u for your response i think now i will start..
All the best
|
|
|
|