|
well there's nothing to see the difference here ^^
|
|
|
|
|
CStatic is a MFC class (WIN32 doesn't have wrapper classes). And C doesn't have classes neither.
So CQFD
|
|
|
|
|
oops, i didn't watch further, and i only saw a pointer to a "user defined type"...lol
CQFD
|
|
|
|
|
li zhiyuan wrote: m_hbmp=m_vicImg.hBitmap;
Assigns to this object's (a CDialog derived class?) m_hbmp member (probably a HBITMAP, i.e. a Bitmap handle) the value of m_vicImg.hBitmap (i.e. the member hBitmap of the m_vicImg object (that you only know and probably is another member of this object).
li zhiyuan wrote: CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1);
Gets a pointer to a CStatic object representing the dialog static control having ID equal to IDC_staImg1 .
li zhiyuan wrote: pImgPicture->SetBitmap(m_hbmp);
Calls the SetBitmap method of the CStatic object. This should change the bitmap represented by the dialog static control.
BTW You can also get some information reading MSDN documentation.
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
|
|
|
|
|
You can declare a variable for static control instead make a pointer.
|
|
|
|
|
My Visual Studio Browser keeps attempting to search for items on the web instead of my pc. What can I do to disable this feature ?
I am using visual Studio 97. I tried uninstalling and reloading Visual C++ 5, made no difference.
And all I get is This Program Cannot Display the Web Page. I am running Xp Home Edition.
Thanks
|
|
|
|
|
I am not sure exactly in which place to edit.
Is you machine is connected to a Network (Lan or wan or anything)
if it so then there will be a file in which you will be giving
the host name list. there you have to go and and remove the unwanted
ip. that may solve your problem. I am sorry i cannot recollect
the file name. I m extremely sorry for my poor memory.
|
|
|
|
|
Hi all,
I have the below code:
str.Replace("\r\n", CString((unsigned char)0xB6));
Here i have a CString object 'str' with some string value. It seems '0xB6' stands for line separator or something.. Im not sure.. Well this is the existing code. But when i tried to convert the project to VC++ 2005 i am getting the compile error as:
error C2440: '<function-style-cast>' : cannot convert from 'int' to 'CString'; No constructor could take the source type, or constructor overload resolution was ambiguous.
Kindly help to resolve this error.
Thanks
Priya Sundar
modified on Monday, March 10, 2008 1:03 AM
|
|
|
|
|
just try not to enforce into unsigned char :
str.Replace("\r\n", CString((char)0xB6));
|
|
|
|
|
Yes it did resolve my error. But now i am getting a warning.
"warning C4310: cast truncates constant value"
I need to assign a value between 0 - 127 to resolve the warning. But since the val for 0xb6 is 182, will i not be able to eliminate this warning?
Any suggestions?
Priya Sundar
|
|
|
|
|
Priya_Sundar wrote: Yes it did resolve my error. But now i am getting a warning.
"warning C4310: cast truncates constant value"
I need to assign a value between 0 - 127 to resolve the warning. But since the val for 0xb6 is 182, will i not be able to eliminate this warning?
Any suggestions?
Priya Sundar
The actual range of acceptable values should be -128 to 127, and I think 0xB6 maps to -74. However, I think unsigned char is the right type for what you are doing, and CString requiring a signed character poses a problem. You may be able to use a string "\xB6" instead of a character to initialize the CString.
Nathan
|
|
|
|
|
Try some thing like this,
CString tempStr;
tempStr.Format("%d",0xB6);
str.Replace("\r\n", tempStr);
|
|
|
|
|
There are two overloads of CString::Replace: one takes two LPCTSTR parameters while the other takes two TCHAR parameters.
When converting to Visual C++ 2005 you normally run into two issues:
1. The default character type is now Unicode;
2. The new compiler is more conformant to the C++ standard
Here you have an additional complication that CString has changed significantly (it's now a template, for example).
The MFC 6.0 version would have called the CString constructor that takes a TCHAR ch and an integer nRepeat, which was defaulted to 1. This version of the constructor generated a string of nRepeat copies of ch. This still exists in MFC 8.0 but has been marked explicit , which means that the types must match exactly.
However, calling a CString constructor is unnecessary - you should instead use a string literal.
str.Replace( "\r\n", "\xb6" ); Because of the change to Unicode, you may find you need to put _T() around both string literals.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thankyou very much.
My errors are resolved.
Priya Sundar
|
|
|
|
|
I have a C++ win32 console application (built using Visual Studio 2005). I have complete code. I need to convert this console application to a dll and I want to call this DLL in a ASP.Net web service (Just because I know how to create an ASP.Net webservice). I am totally new to C++ programming but now I am getting better at it.
I have successfuly created the DLL of that console app (by changing project properties)and also imported the DLL function successfuly. I can debug the dll code when called from my C#/C++ managed console app (I have tried both C++ and C#).
The problem is when ever the code in DLL uses a std::vector, or any other STL based contianers. The code gives exception i.e.
An unhandled exception of type 'System.AccessViolationException' occurred in C++ManagedConsole.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
can someone please point me to a possible solution for this problem. Though I have the code but I cant just remove all the code using the std::vector, or other containers.
Thanking in advance for any kind of hints.
|
|
|
|
|
|
Thanks for the good suggestion. I cant find a way to move this to that forum. I am adding this question now.
|
|
|
|
|
s.m.shah wrote: I cant find a way to move this to that forum
actually, there's none. only Administrators can move a thread, so don't care too much of this.
but asking the right forum will certainly bring you much relevant answers
|
|
|
|
|
Hi,
In my coding,I used some arrays in structure and i stored values in memroy in size of that structure.
And also i give the memory limit to store that particular varialbe in that memrory address.
For example
struct de
{
float IV [300];
char FAIL [300];
}s;
I have one offset file showing memory details for that particular varialbe.The offset file looks like this
as
Variable name
SCope(Variable or Constant)
varialble type(float(2) or int(1) or char(0))
Memory address
Size1
size2
//////////////
FAIL
V
0
0
300
-1
IV
V
2
300
300
-1
///////////////
Like this i have offset file and i stored value for this two varaibles in my coding and i set memory also.But when i retrive this value by using pointer
I get the correct value of variable of char but in case of float it shows 0 only.
Is there any tool to see the value stored in particular memory address?
Anu
|
|
|
|
|
Yes, the debugger.
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
|
|
|
|
|
Anu_Bala wrote: Is there any tool to see the value stored in particular memory address?
1. Put a break point near the variable you want to check.
2. Start debugging.
3. From Debug menu, open up the auto, locals and memory window
4. Get the startig address. For instance, if you have an array like int *pIntArray, look for its address in the locals / auto window. Copy it.
5. Paste it in the memory window.
After this, any modification at that address will be indicated in the memory window.
Hope this helped.
Signature is a waste of time. I'll have one when I've got enough time to create. Well, I had enough a few seconds back.
|
|
|
|
|
hi everyone,
good afternoon to all.rajesh is right i am girl not guy ok.. i have one function called writecard(),
long CACR120RWBLOCK1Dlg::writecard(BYTE BLCK, CString strData)
{
int ctr;
int x;
//writecard(BLCK,strData) = -1;
BYTE dout[15];
for (ctr=0;ctr<=15;ctr++)
{
dout[ctr]=atoi("");
}
x=strlen(strData);
for(ctr=0;ctr<=x-1;ctr++)
{
dout[ctr]=strData[ctr+1];
}
retcode = ACR120_Write(rHandle, BLCK, dout[0]);
//writecard(BLCK,strData) =retcode;
return retcode;
}
this function i am using in my main write function or in write function i am calling this function. but i am getting one problem is that the value of retcode is not assigning in main write function.please tell me how can write this function. in main write function is like this:
void CACR120RWBLOCK1Dlg::OnWrite()
{
BYTE BLCK;
BYTE ResultSN[11];
BYTE TagType[50];
BYTE ResultTag;
char SN[100];
int ctr;
int x;
//writecard()
BYTE dout[15];
BLCK =0;
sec = 2;
BLCK = sec * 4 + BLCK;
//retcode = ACR120_Write(rHandle, BLCK, dout[0]);
writecard(BLCK,m_MemId);
if(retcode >= 0)
{
}
else
{
messagebox();
}
}
please help me out.....
thanks in advance.
savitri:
|
|
|
|
|
this is quite unreadable.
please edit your post (with the "edit" button on it - not by submitting the same post again) and place your code sample into <pre></pre> blocks.
this will format the code and keep the indentation...
|
|
|
|
|
please refer l-value[^]
writecard(BLCK,strData) = retcode; will not evalutes to assignment expression.
join Book-Buying Band[^]
this time,
long CACR120RWBLOCK1Dlg::writecard(BYTE BLCK, CString strData)
{
int ctr;
int x;
long retcode = -1;
....
retcode = ACR120_Write(rHandle, BLCK, dout[0]);
return retcode;
}
void CACR120RWBLOCK1Dlg::OnWrite()
{
....
long retcode = writecard(BLCK,m_MemId);
if(retcode >= 0)
{
}
else
{
messagebox();
}
}
savitri wrote: i am girl not guy ok..
I think most of us wont bother.
|
|
|
|
|
Rajkumar R wrote: join Book-Buying Band[^]
You still remember!
Maxwell Chen
|
|
|
|