|
My program crashes on a client's pc (with XP) on this 3 lines (on any other pc it correcly runs):
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->SetForegroundWindow();
m_pMainWnd->UpdateWindow();
They are default instruction in the initialization function (InitInstance ) of a MFC program.
My antivirus (COMODO) tells a warning on UpdateWindow because when run trys to install a global hook on "atioglxx.dll" (It looks a dll from my ATI video board). If I do not permit this the program stops, else runs perfectly.
I'm quite sure that some setting of the antivirus of the client is locking this function! Or that his video-board isn't so compatible with this function.
Why this hook? Is it important? can I avoid this to let the program run on every pc?
Any other solution?
Of course there is the easy way (but not the real solution) to tell to the user to disable the antivirus (I think it is Norton)
Thanks
Russell
|
|
|
|
|
Russell' wrote: Is it important? can I avoid this to let the program run on every pc?
Have you tried?
"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 All
I am try to get values from Mysql database.I am using pRecordset class for get data from Mysql.But it's generate error while the data type is Decimal.
strContent = (char *) (_bstr_t) pRecordset->Fields->GetItem((_bstr_t)"Price")->Value;
Table is
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10),
G DOUBLE(100,10), H DECIMAL(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5323423424.00004343434300000);
|
|
|
|
|
Error is
IDispatch error #3105
Plz help me
|
|
|
|
|
Have you tried:
A)
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10), G DOUBLE(100,10), H DOUBLE(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5323423424.00004343434300000);
B)
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10), G DOUBLE(100,10), H DECIMAL(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5.5);
"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 Experts,
When I declare a Object of the class, How it store into memory i.e which memory segment it used?
|
|
|
|
|
MPTP wrote: which memory segment it used?
I presume you are trying to distinguish whether it is stored on the heap or the stack. If you create an object via new() then it goes to the heap. If it is a local variable it goes on the stack.
|
|
|
|
|
MPTP wrote: memory segment
Do you want to know if an instance of a class is stack or heap allocated?
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]
|
|
|
|
|
If you have created the object like. Myclass m;
the object is stored on the stack
if you have done-- Myclass* m = new Myclass();
the memory is allocated from the heap.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
the runtime takes care which memory is used. Every time a object is created some memory will be used. You can get the information about that getting the address of of the object.
In C++ you 3 ways to create objects
Sample code:
void sampleFunc()
{
Object obj1;//Stacke with automatic destruction
Object *addrObj = &obj1;//getting the address of memory
//do not
//delete addrObj;//Bug
Object *pObj = new Object();//Heap and manuell destrucion needed!!!
delete pObj;// to avoid memory leak;
}
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
As replied by the others here, whether stack or heap is used is not dependent on a class.
For memory allocation, a class is nothing but a chunk of a particular size.
In fact it is the same for a structure, class, fundamental types, arrays etc.
Dynamic allocation (new, malloc etc.) allocate memory on the heap.
Function arguments and local variables use a stack.
A separate stack exists for each thread.
Initialized global variables are created in a separate section in the the executable.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hello friend,
plz tell what is the syntax error in belows access query.pdpstate is the name of table
INSERT INTO pdpstate(setid,power,input,aspect,ontimer,offtimer,multiscreen,
volume,mute,balance,treble,bass,brightness,contrast,tint,red,green,blue,frequency,phase,
hposition,vposition,displayflag,ontimehour,ontimemin,ontimeampm,ontimeonoff,ontimevolume,
offtimehour,offtimemin,offtimeampm,offtimeonoff,failcount,sharpness,color,rgb_contrast,
rgb_brightness,pip_onoff,pip_aspect,pip_source,ontimesource,service5v,service12v_main,
service12v_audio,servicelamp_time1,servicelamp_time2,servicelamp_time3,servicelamp_status,
rgb_sharpness,rgb_colortemp,shiftonoff,h_dot,v_line,shifttime,wiper,allwhite,videowall,
timedisplay,eq100hz,eq300hz,eq1khz,eq3khz,eq10khz,bbe,max_hour,max_min,max_ampm,max_value,
min_hour,min_min,min_ampm,min_value,autolamp,scroll_period,scroll_time,colortone,comport,
vwallmode,scroll_type,tv_select,wall_div,wall_sno,rgb_colortone,lamp_error,temperature,
br_sensor,no_sync,current_temp,fan_error,tv_ mode,major_ch1,major_ch2,sel_minor,
minor_ch1,minor_ch2)VALUES('0','1','30','16','1','1','10','80','0','50','10','60','20','0','30',
'26','88','29','40','20','1','1','0','2','9','0','1','5','10','7','0','0','0','76','0','20','20',
'1','0','20','33','1','1','1','1','1','1','1','2','2','1','1','1','1','1','1','1','1','1','10','1',
'1','1','1','63','255','1','100','63','255','1','255','70','1','1','2','1','1','6','1','36','3','1',
'0','0','0','1','44','0','20','4','50','20','10','5')
regards
jitu
|
|
|
|
|
You're kidding, right? Anyways, this[^] section might be more suited for these kinds of questions...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Beware: you're just one step away from Liquid Nitrogen.
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]
|
|
|
|
|
Start with this:
INSERT INTO pdpstate(setid)VALUES('0')
If that works, add another field/value pair. Continue until syntax error appears.
"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 an application that uses on document structure, am converting to to MDI from SDI. I've got that part handled except for child windows. I want to create a child window for different instances of the application, like add order, add location, add machine, etc... How could I go about creating different child windows that could be open at the same time as the other ones?
|
|
|
|
|
|
Cipher 22 wrote: I want to create a child window for different instances of the application...
Really?
"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
|
|
|
|
|
i has been created one login.aspzx page and one master.aspx page
when i login ,i m directly redirect to master page.master page contain logout button(linkbutten).
when clicked on logout button,the page has redirect to login page.
My problem is that,in that (after i clicked the logout button)when i clicked the "Back" it will move to master page.
i want clear the session?????
login.aspx page :
protected void buttonLogin_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(TextBox1.Text))
{ //Focus box before showing a message
// textBoxUsername.Focus();
TextBox1.Focus();
//MessageBox.Show("Enter your username", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Enter your username');</script>");
//Focus again afterwards, sometimes people double click message boxes and select another control accidentally
TextBox1.Focus();
// textBoxUsername.Focus();
return;
}
else if (string.IsNullOrEmpty(TextBox2.Text))
{
// textBoxPassword.Focus();
TextBox2.Focus();
// MessageBox.Show("Enter your password", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Enter your password');</script>");
TextBox2.Focus();
// textBoxPassword.Focus();
return;
}
using (DataTable dt = LookupUser(TextBox1.Text))
{
if (dt.Rows.Count == 0)
{
TextBox1.Focus();
// MessageBox.Show("Invalid username.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
Response.Write("<script> alert('Invalid username.');</script>");
TextBox1.Focus();
return;
}
else
{
//Always compare the resulting crypto string or hash value, never the decrypted value
//By doing that you never make a call to Decrypt() and the application is harder to
//reverse engineer. I included the Decrypt() method here for informational purposes
//only. I do not recommend shipping an assembly with Decrypt() methods.
string dbPassword = Convert.ToString(dt.Rows[0]["Password"])…
string appPassword = (TextBox2.Text);
//we store the password as encrypted in the DB
if (string.Compare(dbPassword, appPassword) == 0)
{
Session.Add("islogin", true);
Response.Redirect("Firstmain.aspx");
}
else
{
//You may want to use the same error message so they can't tell which field they got wrong
TextBox2.Focus();
// MessageBox.Show("Invalid Password", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Invalid Password');</script>");
TextBox2.Focus();
return;
}
}
}
}
master page :
protected void Page_Load(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToLongDateString();
if ((Session["islogin"] == null) || (Session["islogin"] == ""))
{
Response.Redirect("frmLogin.aspx");
}
}
//protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
//{
// Response.Write("LoggingOut event. Don't go away now.");
// e.Cancel = true;
//}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session.Remove("islogin");
Session.Clear();
Response.Redirect("frmlogin.aspx");
}
send mi solution as soon as possible
|
|
|
|
|
Wrong forum.
Try the ASP.Net forum[^].
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi
How to read text from image file ..?? please share with me ...
regards
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
An image file is a binary file.
You can use CreateFile[^]/ReadFile[^] APIs to read the contents of the file.
Or you can use the C runtime functions fopen[^]/fread[^].
Give fopen("file", "rb"); to open the file in binary mode for reading.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
What do you mean exactly by that ? Do you mean that you have an image with some text on it and you would like your program to be able to read it ? Well, that's certainly not a trivial task at all. You'll need to look for OCR (optical character recognition), you will eventually find some library (perhaps free).
|
|
|
|
|
I have a whole bunch of coclasses and corresponding interfaces.
I want to get an interface, IA, say:
IA* pIA;
CComPtr<IUnknown> pIUnknown;
pIUnknown.CoCreateInstance(__uuidof(A));
pIUnknown->QueryInterface(__uuidof(IA), (LPVOID*)&pIA);
But I also have coclass B and interface IB.
When I run this piece of code, __uuidof(A) is definitely getting the CLSID of A and not B (I've chased it down as far as I can go):
__checkReturn HRESULT CoCreateInstance(__in REFCLSID rclsid, __in_opt LPUNKNOWN pUnkOuter = NULL, __in DWORD dwClsContext = CLSCTX_ALL) throw()
{
ATLASSERT(p == NULL);
return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&p);
}
But, "p" in the above code points to B and no to A, despite rclsid clearly showing CLSID of A.
I've gone through my code several times checking order of things being declared, variables not getting cleared when reused, GUIDs getting mixed up etc. None of these seem to be the problem. In fact, CoCreateInstance to this coclass works fine in other parts of the program. It just fails in this particular instance.
Any ideas how to approach this problem?
Please help!
|
|
|
|
|
Does A also expose interface IB? If so, then that's entirely understandable - you expose two interfaces, each derived from IUnknown. The vtable layout of IA will have the methods of IUnknown immediately before the methods of IA (presuming IA derives directly from IUnknown), and the vtable layout of IB will have the methods of IUnknown immediately before the methods of IB (again presuming IB derives directly from IUnknown).
What's going to happen when you have A deriving from IA AND IB? Well, it concatenates their vtables, so that they both have an IUnknown vtable immediately preceding their own methods, preserving the layout you'd see for any one of the interfaces. So, when you ask for an IUnknown interface pointer, it has to pick one of them, so an IUnknown pointer will point at either an IA or IB interface - it doesn't really matter.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|