|
I have a CListCtrl object with LVS_EX_SUBITEMIMAGES included in extended style. This will let me include images inside subitems.
The subitem images are displayed fine
I don't want images inside the first column, but it does display image 0. After setting that id to -1 the list doesn't display an image but it keeps a space inside the first column as wide as the images.
What can I do to prevent this?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Hello,
I need a hint how to copy files from virtual folders.
My digital camera is connected as virtual folder in 'my computer' -> 'control panel' -> 'scanners and cameras'.
It is not difficult to gain access to that camera by using iterative IShellFolder commands. GetDisplayName generates a full path like:
'::{GUID of my computer}\::{GUID of control panel}\::{GUID of scanners and camera\devid:{GUID of camera}\0003:\0003\Root\Ext0\DCIM\100Ricoh\picture1234.jpg'
SHOperation fails when passing this path.
Any help is appreciated.
Thanks in advance!
Sebastian
|
|
|
|
|
After I connect my camera to the computer, the drivers create a drive letter for it. In this case, it's always E:, so I can copy files all day long from drive E:.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
you are right, some cameras create volumes.
Any helpful comments?
|
|
|
|
|
sieppl wrote:
Any helpful comments?
No, I was just offering a suggestion that you obviously already considered.
Perhaps you could use CreateFile() , specifying the driver or device name as the first parameter. In the registry, try looking in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_040a&Pid_0571\KCKCL35220205\Device Parameters key for your camera's symbolic name. Note the values in red will be different on your machine. For example:
HANDLE hFile = CreateFile("\\\\.\\USB#Vid_040a&Pid_0571#KCKCL35220205#{a5dcbf10-6530-11d2-901f-00c04fb951ed}\\PIPE01", ...);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
okay thanks. i'll try that.
|
|
|
|
|
Hello All,
I have a program that is doing something and stop doing whatever he's doing and look at something else every 10 mins ( whatever the time is)
so I used OnTimer. No problem for certain times but at one point I got following error message.
Unhandled exception at 0x7c28ef6a in SMPServer.exe: 0xC0000005: Access violation reading location 0x00000020.
here the code that I wrote.
Why do I get the error after calling the DoSomething() for several times and died at next time DoSomething() gets call again? I tried killing Timer in DoSomething() and the result is the same. DoSomethings() gets called several times (probably 3 or 4 times) and die at next time. Am I missing something or am I using timer in wrong way?
<br />
int m_nTimer;<br />
const int TimerID = 1;<br />
const int Timeout = 5000;<br />
<br />
BEGIN_MESSAGE_MAP(CSMPServerDlg, CDialog)<br />
...<br />
...<br />
ON_WM_TIMER() <br />
..<br />
..<br />
END_MESSAGE_MAP<br />
<br />
void CMyDlg::DoSomething()<br />
{<br />
....<br />
m_nTimer = SetTimer(TimerID, Timeout, NULL);<br />
.....<br />
}<br />
<br />
void CMyDlg::OnTimer(UINT nIDEvent) <br />
{<br />
CDialog::OnTimer(nIDEvent);<br />
KillTimer(m_nTimer); <br />
if (nIDEvent == TimerID)<br />
{<br />
isStillTalking = false;<br />
PostMessage(WWPrinting); <br />
} <br />
}<br />
|
|
|
|
|
Remember that timers are a limited global resource. I forget the exact number that can be in existence at any one time but it wasn't very many.
Contrary to some documentation, the timer ID, not the SetTimer() return value, must be used when killing the timer.
Just curious but why do you continually call SetTimer() and KillTimer() ? Wouldn't it be sufficient to call each just once?
Also, the call to the base class implementation of OnTimer() is not necessary if nIDEvent is your timer.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi!
I wonder how I could use STL with visual C++ 6.0? I have used STL together with Dev C++(Cygwin) and it works fine. But when I try to run under Visual C++ it generates alot of errors. Any suggestions on how to solve this? Do i need some upgrades?
regards
M_A
|
|
|
|
|
STL support in MSVC++ 6.0 is certainly poor, but still you can use it without too many hassle. If you encounter a particular problem post it here and perhaps we'll be able to help you.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
M_A wrote:
But when I try to run under Visual C++ it generates alot of errors
what are the errors?
Software | Cleek
|
|
|
|
|
Hello M_A,
Please check to see if the errors you mentioned are actually warnings.
I believe alot of Visual C++ 6.0 users who use STL will certainly have encountered many warnings during compilation. Apparently alot of these warnings can be ignored. The usual recommendation is to use the #pragma warning preprocessor command to ignore the warnings.
I've encountered articles written by well-known authors who advocate this.
Hope this helps.
Regards,
Bio.
|
|
|
|
|
Hello again!
This is an extraction from one of my projects and it works perfect on Dev C++, but not on Visual C++ 6.
.................................
#include <iostream>
#include <iomanip>
#include "jumper_info.h"
using std::cout; using std::endl;
using std::cin; using std::ios;
bool compare (const Jumper_info& a, const Jumper_info& b);
std::ostream& operator << (std::ostream& out, std::vector<jumper_info>);
int main ()
{
int count=0;
Jumper_info temp;
vector<jumper_info> theJumpers;
theJumpers.reserve(20);
vector<double> points;
while(cin >> temp) {
calculate_result(temp);
theJumpers.push_back(temp);
}
std::sort(theJumpers.begin(),theJumpers.end(),compare);
int counter=0;
for(vector<jumper_info>::const_iterator i =theJumpers.begin(); i !=theJumpers.end();i++) {
counter++;
cout <<counter <<="" "="" *i;
}
="" return="" 0;
}
this="" file="" alone="" generates="" the="" following:
...........................................................
eader\main_uppg2.cpp(39)="" :="" error="" c2039:="" 'sort'="" is="" not="" a="" member="" of="" 'std'
c:\temp\0901\reader\main_uppg2.cpp(39)="" c2065:="" undeclared="" identifier
c:\temp\0901\reader\main_uppg2.cpp(42)="" c2653:="" 'vector<struct="" jumper_info,class="" std::allocator<struct="" jumper_info=""> >' : is not a class or namespace name
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'const_iterator' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ';' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'i' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2440: '=' : cannot convert from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2446: '!=' : no conversion from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2040: '!=' : 'int' differs in levels of indirection from 'struct Jumper_info *'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ')' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : warning C4552: '!=' : operator has no effect; expected operator with side-effect
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ';'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ')'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2143: syntax error : missing ';' before '{'
c:\temp\0901\reader\main_uppg2.cpp(44) : error C2100: illegal indirection
...............................
I also get problems with getline in the following part.
getline(in,jumper.name,'\n');
Thanks for all the help!
|
|
|
|
|
I'm using Visual C++.net 2002 With MFC. I know I can declare a path
"C:\\folder\\file.txt but is there a way to declare it "C:\folder\file.txt" . If so how? Thanks for any help.
|
|
|
|
|
For string literals, backslashes must be doubled. Why is this a problem?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Sometimes it can create very strange bugs if you forget one double backslash in a path... I have never liked this, but I have learned to live with it...
|
|
|
|
|
In C# you can in C++ you can't.
For C# use the @ like this:
@"C:\folder\file.txt"
the "\\" is still valid in C# (without the '@');
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Im trying to make a program that will ping an ip and then i will play with the output to then log it to a file. My problem is this is new to me hehe and i have no clue how to call a variable in the function system();
This is what i have up to now
<code>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
string ip;
cout << "Welcome to test app";
cout << "\nEnter an ip: ";
cin >> ip;
cout << "\nGonna try to ping " << ip << "\n";
char output [100];
system("ping -c 2 ", ip);
cin.getline(output,100);
cout << output;
return 0;
}
</code>
Now the line system("ping -c 2 ", ip); definatly doesnt work and that is where im stuck atm. ANd it is hard to search on google when you have system as keyword hehe.
Anyone can gimme a hand?
Thanks
|
|
|
|
|
MrJake wrote:
Im trying to make a program that will ping an ip and then i will play with the output to then log it to a file.
Yuck! Why use such an antiquated method when a direct approach is much simpler? The ICM protocol is easily Googled and there are several examples here at CP on how to make a ping-like application. The last time I put one together, it was about two dozen lines of code.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello MrJake,
I agree with David Crow that using TCP/IP APIs would be far more superior to the technique that you are presently using.
However, to achieve your approach, I suggest declaring a string variable and then use it to build up your command line (for the system() function). I would also suggest redirecting the output of "ping.exe" to some external file that you can open up and read in order to process and analyse the output of ping.exe.
The following is an example :
char command_line[100];
sprintf (command_line, "ping -c 2 %s > ping.txt", ip);
system(command_line);
...
...
...
Give it a try.
Regards,
Bio.
|
|
|
|
|
hi
one more favour plz....... how do v change grid lines color in list conrol
thnks
Muhammad Azam
|
|
|
|
|
hi
i want to change the row height of a list control (report style). can any one help me, how to change row height of report sytle list control.
i have searched a lot for this on internet but no one has posted any such article.
thanks in anticipation
Muhammad Azam
|
|
|
|
|
Reposted here from Operating Systems / SysAdmin. I apologise if this is impolite but it seems more likely to get answered here.
I need a simple, programmatic way to set up a small number of accounts on new PCs running Windows XP.
I'm prepared to write script (VBScript or Javascript), .NET code (C#) or even an app in C++
Please can someone give me a clue as to where would be the best place to start. Just pointing me to something relevant on MSDN would be fine.
Thanks in advance,
Phil
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
OK, try MSDN here NetUserAdd[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Excellent! Thanks, I'm off and running.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|