|
This type of question would probrally get a better answer in the SQL forum. Expanding on what Chris said read this article SQL Injection Attack[^] for more information. Your really opening up the entire db to malice.
See the W3Schools for info on how the Insert Into Statement[^] works.
INSERT INTO table_name (column1, column2,...)<br />
VALUES (value1, value2,....)
Good Luck!
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi all. Im having a link error when i compile 3 source files together.
<br />
error LNK2001: unresolved external symbol __imp__SendMessageA@16<br />
Thats just one out of 4 errors. I've googled the error msg and found that other have had the same problem, but neither of their problems were ever resolved( at least not on the article/forum) So since i have this issue and i'd like to know what i need to update/change to fix this error. Im using VC++ 6 platform SDK 2003
Everything is in order to compile in the settings etc. From what i've read its some sort of out-dated problem. But how can it be out dated if i can compile the source by itself?
It would'nt compile if it was so out-dated right?
Any suggestions on what i should do is appreciated as always. Thanx in advance!
|
|
|
|
|
Are you linking to "user32.lib"? I'd guess not (and you should be).
Steve
|
|
|
|
|
Lets say I have a text file named text1.txt, with a few lines of text. I want to include the file as resource in the .exe, so that no one can read the file. Then I want to be able to use it just as if it was an external file, such as std::ifstream fin('text1.txt'). What steps need to be taken so that that line of code std::ifstream fin('text1,txt'), will work for an internal resource?
|
|
|
|
|
It depends on which path you choose. If you want to be able to use it exactly as a file (i.e. open with CreateFile or std::ifstream ) it would be a lot of work; don't even go down that road. The easiest way would be to write your own stream class that reads from resources; for this task I'd use the Boost.Iostreams[^] library.
Steve
|
|
|
|
|
whenwood wrote: I want to include the file as resource in the .exe, so that no one can read the file.
I believe much like dialogs, menus, toolbars and string resources file resources could easily be read using Visual Studio. Just open the binary with Visual Studio as a resource. If your intent is to ultimately store this information privately then encrypt it in a file. Trying to write info back to a file within the binary is error prone.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
You can use, sure, import resource command in resource editor and choose the file as external file; the resulting binary will now contain a resource that can be accessed using FindResource, LoadResource, LockResource etc. (Perhaps is even better to use a separate dll only for this purpose).
On the other hand, ifstream (basic_ifstream) have contructor only with a filename. Maybe basic_istream will do it, passing in constructor a basic_streambuf for resource and probably false for 2nd argument, _Isstd. I think implementing a derived class from basic_streambuf to use with the text resource file can do it.
|
|
|
|
|
hi all
i want to find the difference between two times
say example now i have started a application and after 1 min i want to see the difference
how to do it
shall i call GetSystemTime twice .
please help me with an example
Thanks in Advance
abhi
|
|
|
|
|
It depends on how accurate you need the measurement to be. You can call time() twice and compare the values, if 1-second resolution is OK. Or call GetTickCount() if the system timer is accurate enough.
|
|
|
|
|
The best solution is the following
DWORD Currtime;
DWORD SecondTime;
DWord Diff;
CurrTime=timeGetTime();
// Wait for some time here.. say about 10 seconds...
Sleep (10000);
SecondTime=timeGetTime();
now,
Second Time - Currtime will be equal to 10000.
i think its clear enough...
haribabu
(impossible to understand)
|
|
|
|
|
Hi,
I use a customed treeview which class is derived from CView and I use a CtreeCtrl object to populate the tree programmatically. Now I would like to have a copy or a "replication" of my tree loaded into another CtreeCtrl which container is a dialog box.
Please do you know if is there a solution to do this with few coding?
Many thanks for your help.
|
|
|
|
|
As a guess, and assuming that the CtreeCtrl has a copy constructor, you may be able to use the CreateDialogParam function to pass the address of the current one to the dialog as the lParam of the WM_INITDIALOG message and then assign it (copy construct it) to the copy. Of course if you can do that then you may be able to just add a member to the dialog class and assign it there, during construction. Another option would be to find away to separate it so that a function call from the view or the dialog so that either one can access it, but I do not know if that is possible.
Like I said, I am just guessing here because I am out of practice and have not done it myself.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi all. I've found out how to keep a function from repeating the same string over and over. But i have another challenge. I was wondering if i could pick out certain chars etc. So i decided to play with strstr. But i have 2 errors. Here a sample code of the time function im using.
<br />
#include <time.h><br />
#include <windows.h><br />
#include <fstream><br />
using namespace std;<br />
<br />
int main (){<br />
char olddate[9] = {0}, oldtime[9] = {0};<br />
while(1){<br />
Sleep(300);<br />
char date [9];<br />
char time [9];<br />
_strdate(date);<br />
_strtime(time);<br />
bool fNewDate = strcmp(date, olddate) != 0;<br />
bool fNewTime = strcmp(time, oldtime) != 0;<br />
if(fNewDate || fNewTime){<br />
ofstream file1;<br />
file1.open("time.txt",ios::app);<br />
if(strstr(fNewDate,"1/13/07"){<br />
file1 << "[Date]: " << date << endl;<br />
strcpy(olddate, date);<br />
}<br />
if(strstr(fNewTime,"5:30"){<br />
file1 << "[Time]: " << time << endl;<br />
strcpy(oldtime, time);<br />
}<br />
file1.close();<br />
}<br />
}<br />
return 0;<br />
}<br />
The idea is to match a string like "1/13/07" with another string from the time function and save to the file. But instead i get 2 errors.
<br />
error C2664: 'strstr' : cannot convert parameter 1 from 'bool' to 'const char *'<br />
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast<br />
Any suggestions?
|
|
|
|
|
You are passing 'fNewDate' and 'fNewTime', which are bools, to 'strstr' at two different places in your code, instead of a string.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
From the MSDN
char *strstr( const char *string, const char *strCharSet ); But your value is bool fNewTime
|
|
|
|
|
Hi,
I need a control where I can view 32x32 icons to the left side (32bit color depth if possible) along with some information placed to the right of the icons (to make it clearer, I just need something like a listview control in report mode with 32x32 icons instead of the 16x16 icons), is it possible to have 32x32 icons in a listview control in the report mode or do I have to use subclassing? In case that I have to use subclassing, which control do you think I should use? ListView, ListBox, TreeView or some other control? Or finally do you think I should write my own control from scratch?
Thanks in advance,
Wal
|
|
|
|
|
You can use whatever size image list you want in a list control. 32x32 and 16x16 are the most-commonly-used sizes, but there's no rule that you have to stick to those sizes.
|
|
|
|
|
How can I set Attached or Detached second monitor in win32?
|
|
|
|
|
Call GetSystemMetrix() and pass SM_CXVIRTUALSCREEN/SM_CYVIRTUALSCREEN as the parameter. The call would return the size of the virtual screen of all monitors.
Best,
Jun
|
|
|
|
|
i compile in debug mode & there is no run-time or exception!
But when i compile in release mode there is __non_rtti_object exception!
how can i find which pointer is null that cause this exception in release mode?
Best Regards,
M.J.M.
|
|
|
|
|
How can I find the corresponding country of an IP address?
modified 8-Mar-17 3:51am.
|
|
|
|
|
|
|
I am unable to obtain a pointer to the interface INetConnectionCommonUi.
I have called INetConnectionManager's and INetConnectionManagerEvents's QueryInterface with the IID_INetConnectionConnectUi. No go.
I have tried using ::CoCreateInstance using CLSID_ConnectionManager and IID_INetConnectionConnectUi and cannot instantiate this INetConnectionCommonUi.
In both instances, E_NOINTERFACE is returned.
These GUIDs and interfaces are found in Visual Studio 2005's netcon.h header file.
Has anyone had success implementing these interfaces and, if so, how?
|
|
|
|
|
hi all
can u plz tell me what is this line for
int *(*table())[30];
and if its an array or a variable how can i access it ?
thanks
|
|
|
|