|
thanks for your reply, I have read the document, but I am not sure how to access PDF files.
the error is as follow:
error C2011: 'IAccessible' : 'struct' type redefinition
...
many this kind of error.
the headers imported is a wrap of I* interface,for example
CAccessible == IAccessible.
CAccID == IAccID
|
|
|
|
|
It looks like you have duplicate definitions in one or more of your source files. Check which headers you are including.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I know this, but I really didn't include more than one header. I am quite puzzled. thanks all the same.
|
|
|
|
|
I have recently spent some time getting some of my apps looking right on XP styles, by adding a manifest resource, and also modifying some controls that are custom-drawn.
However, if I use my xp-style-enabled controls in apps which do not have a manifest, and therefore draw using the old style, I find that my controls still draw with the current XP style. I have used IsAppThemed() as a way of determining how to draw my controls, but I have found that this returns TRUE even though the app is not XP-style-enabled, making the control look odd! I have tried using IsThemeActive but this also always returns TRUE.
Does anyone know how I can find out if the app is XP-styled (ie the other controls are using the XP-styles)?
|
|
|
|
|
See this MSDN blog post[^].
I'm not really sure if this is of much help for you. But you may find some clues in the comments.
|
|
|
|
|
Thank you. I found an answer
|
|
|
|
|
1 )
int a;
a = 5;
2 )
int a(5);
3 )
int a = 5;
Prafulla Vedante
|
|
|
|
|
In case 1 you have declared the variable a but it has no value; in reality it will but its contents will be random. The second statement assigns the value 5 to variable a . These two statements do not need to be together, as a can have its value set or reset anywhere it is in scope.
Cases 2 and 3 are the same, the variable is declared and initialised at the same time.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
1. Declaration (after which the variable will be uninitialised, with an unknown value) followed by assignment.
2. Declaration with initialisation. For POD (Plain Old Data, built-in) types, this is effectively no different to 3. but with a class/struct type this would call a different constructor (taking an int parameter, rather than the default constructor).
3. Declaration followed by assignment. Again, for a POD type no different from 2. but with a class/struct type the value 5 could be implicitly converted to the class/struct type in a custom constructor before the assignment, or an assignment operator taking an int could be called.
In questions of declaration, initialisation, assignment and so on, what POD types do is well known and specified in the standard, but what class/struct types do depend on their implementation to a much larger extent.
|
|
|
|
|
Not quite correct. Cases 2 and 3 are equivalent - the assignment operator is, in fact, not used in case 3, not even for a custom class with an override for operator=() .
See GotW#1 for further explanations. I have to admit I wouldn't have known the (lack of) difference before checking that site.
|
|
|
|
|
|
Hello all,
I'm new to C and i received a challenge to work on a project to integrate 2 different machines. One of the machines is a scanner. A protocol was developed to make the conversation" between the 2 machines possible using the serial over USB physical link.
I have the specification of this protocol with the commands that the scanner can receive and what is the expected response. All commands work perfectly however i'm in doubt on how to retrieve the image from the scanner.
See the command definition below:
Request syntax :
000200000000crc16
The scanner response in case of success will be :
[“0002”][length][image data in binary][crc16]
As The payload field in this response will be a BINARY stream of octets that needs no further conversion prior to be saved in a file or to be delivered to its final destination.
To better ilustrate the response is something like:
000200006690bin_datacrc
Where:
0002 is the command
00006690 is the lenght of the img data
bin_data is bin image data
crc
The problem is that i don't know how to handle BINARY stream of octets. I read a couple of articles but they are always related to read bin data from files and in this case we have a stream and i'm not sure if it's the same.
Do you know a possible solution to write this BINARY stream of octets in a file ???
If someone can share some info i really appreciate it!!!
Thanks and congrats for the great job you guys do here at the forums...
Simplicity is the Ultimate Sophistication!!!
|
|
|
|
|
Just use the BYTE (or unsigned char ) type to read and write. I don't know what I/O functions you are using, but you could use the CRT Stream IO functions[^]. Thus to read and write you would do something like:
FILE* fin = fopen("inputfilename", "rb");
FILE* fout = fopen("outputfilename", "wb");
DWORD count = ??; BYTE buffer[999]; int nread, nwritten;
do
{
nread = fread(buffer, sizeof(BYTE), count, fin);
if (nread < 1)
break; if (nwritten < fwrite(buffer, sizeof(BYTE), count, fout))
{
}
} while (nread > 0);
Obviously this needs expanding but it should give you the idea.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Marcio Kugler Rodrigues wrote: Do you know a possible solution to write this BINARY stream of octets in a file ???
It is just a bunch of bytes. If you have the pointer to the first of them (that is the address of the start location wherein you have read them), say buffer , then you have just to issue (assuming you are working on Windows OS ):
FILE * fp = fopen("my_image.tiff", "wb");
if ( fp )
{
if ( length != fwrite(buffer, 1, length, fp) )
{
}
fclose(fp);
}
else
{
}
Veni, vidi, vici.
|
|
|
|
|
Hello everybody,
How can I enabled a service to interact with desktop in 2008 Windows server OS ?
I have a MFC application which is run by being called by another service which its properties are localsystem and interact with desktop.
It works fine at 2003 Windows server OS, but I face problems with 2008 Windows OS (NO GUI enable though I see it as a running process)
Any clue how to let it enables the GUI ?
I searched the internet and forums for any idea but with not much help.
Please advice.
Thanks in advance,
Eyal
|
|
|
|
|
es1968 wrote: how to let it enables the GUI ? It doesn't. Services run in the background and are prevented from having a Windows front end, specifically because they do not have user interaction. You can provide an interface so a normal GUI based program can pass information to and from the service, but that's all that is allowed.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I have an layered window over a CMyView derived from CScrollView. This layered window are created, but are not painting, I mean CLayered::OnPaint are not calling (ON_WM_PAINT is properly mapped)... there is any reason to CWnd::OnPaint not being executed ? Thank you.
|
|
|
|
|
Flaviu2 wrote: is any reason to CWnd::OnPaint not being executed If this was true then nothing would work. You need to look again at your program to ensure that all events are correctly wired up.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thank you Richard, I solved. The area of the layered window was 0. My mistake.
|
|
|
|
|
Hi,
i have inserted the item in list as a file name or path now again i don't want insert the same path in an list control.
i tried with clist find item but i couldn't make it ......
please help me
|
|
|
|
|
CList have CList::Find[^] method ... did you used ? Or you refer on CListBox ?
|
|
|
|
|
sarfaraznawaz wrote: i tried with clist find item but i couldn't make it We have no way of guessing what this could mean. Please explain clearly, with code extracts, what you are trying to do and what results you are seeing.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
sorry for not explaining
m_listCrl = DEBUG_NEW CListCtrl;
if(!m_listCrl->Create(WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_AUTOARRANGE,/*CRect(65, 100, 960, 448)*/CRect (60, 105, 954, 435),this,IDC_LIST_CTRL))
{
TRACE ("\nDBG:\tFailed to create window object for List ctrl at line %u in %s.", __LINE__, __FILE__);
return -1;
}
GetPrivateProfileString (_T ("Remo Eraser"), _T ("IDS_CLOUMN1"), NULL, (LPWSTR)szNewText, sizeof(szNewText), m_szPath);
m_listCrl->GetHeaderCtrl();
m_listCrl->InsertColumn(1,(LPWSTR)szNewText,LVCFMT_LEFT,75+75+25+50+25+25+25,-1);
GetPrivateProfileString (_T ("Remo Eraser"), _T ("IDS_CLOUMN2"), NULL, (LPWSTR)szNewText, sizeof(szNewText), m_szPath);
m_listCrl->InsertColumn(2,(LPWSTR)szNewText,LVCFMT_CENTER,75+75+25+50+25+25+25+10,-1);
GetPrivateProfileString (_T ("Remo Eraser"), _T ("IDS_CLOUMN3"), NULL, (LPWSTR)szNewText, sizeof(szNewText), m_szPath);
m_listCrl->InsertColumn(3,(LPWSTR)szNewText,LVCFMT_CENTER,75+75+25+50+25+25+10-1);
m_listCrl->InsertItem(0,File_Name,NULL);
m_listCrl->SetItemText(0,1,m_Filepath);
m_listCrl->SetItemText(0,2,_T("10KB"));
<pre lang="c++">
here is the code
am adding the file name and file path in an Clist ctl.
am dont want to add the same file name or path in an list .
i tried with FindItem // info.flags =/* LVFI_PARTIAL|LVFI_STRING*/LVFI_PARAM;
// info.psz = m_Filepath;
// Delete all of the items that begin with the string.
// index = m_listCrl->FindItem(&info);
// while ((index = m_listCrl->FindItem(&info))!= -1)
// {
// MessageBox(_T("File Already exists "),_T("Inforamtion"),MB_ICONINFORMATION);
// m_listCrl->DeleteItem(index);
//
// }
<
|
|
|
|
|
First comment, please use <pre> tags around code snippets, as I have done below.
Your LVFINDINFO.flags are wrong, and should be as follows:
info.flags = LVFI_STRING;
info.psz = m_Filepath;
index = m_listCrl->FindItem(&info);
if (m_listCrl->FindItem(&info) == -1)
{
}
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
sarfaraznawaz wrote: m_listCrl->InsertColumn(1,(LPWSTR)szNewText,LVCFMT_LEFT,75+75+25+50+25+25+25,-1); Are you seriously doing this in production code or is this just a personal project?
sarfaraznawaz wrote: m_listCrl->InsertItem(0,File_Name,NULL);
m_listCrl->SetItemText(0,1,m_Filepath);
m_listCrl->SetItemText(0,2,_T("10KB")); This should be:
int nItem = m_listCrl->InsertItem(0, File_Name);
m_listCrl->SetItemText(nItem, 1, m_Filepath);
m_listCrl->SetItemText(nItem, 2, _T("10KB"));
sarfaraznawaz wrote: here is the code am adding the file name and file path in an Clist ctl. am dont want to add the same file name or path in an list . i tried with FindItem You should be using some other data structure that is better suited for searching, or one that doesn't allow duplicates to begin with. Populate the list control from that.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|