|
Pratically this method only works under 98 and ME
for 2000 and XP it doesnt work at all
if u want some code search for hackboy articles
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Chris wrote an article
http://www.codeproject.com/listctrl/listview_callback.asp#xx81618xx[^] on text callbacks which (to the best of my understanding) is basically a method of storing the data used to populate a list control directly rather than implicitly using AddItem() functions. This sounds like what I need for my app. I already store the data in a list which is loaded from a database, so to add similar data to memory sounds ridiculous. The data I store in the list is a record of about 10 fields, but I only need about 6 visibible columns in the list control. The other fields are PKeys for other Lists (filled from a db table) and don't require display.
Anyways by the sounds of things does it sound like Callbacks are my solution? and am I close in assuming Callbacks and Virtual lists are the similar???
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
hi all,
my program add 2 structures, A and B into 2 CTypedPtrList, listA and listB. i found that it crash when the program try to access structure A from listA later on.
however, if i just add A to listA but add B to listB, the program run fine! strange thing is that the procedure lead to crash don't related to neither B nor listB.
any idea? debugger asked dbgheap.c for debugging when crashed. i can't locate it in my hdd. is it related?
and, if i build the code in release mode, it work fine too!
any help?
thanks,
jim
|
|
|
|
|
however, if i just add A to listA but add B to listB
^^^^
it should be "...but NOT add B to..."
thanks,
jim
|
|
|
|
|
Post code. Helps much.
"Perhaps the truth is less interesting than the facts?" -- Amy Weiss, RIAA's Senior Vice President of Communications. It's the new math! 421 == 156 !
|
|
|
|
|
part "add to list"
/*** add A to list A (code is the same inside AddToCommandList) ***/
AddToCommandList(tar_moni_id, tar_port_num, control, priv);
/*** add B to list B ***/
binding_ack_list *pAck = new binding_ack_list;
pAck->moni_id = moni_id;
pAck->tar_moni_id = tar_moni_id;
pAck->tar_port = tar_port_num;
pAck->done = false;
sysinfo.bindingacklist.AddTail(pAck);
part "use the list"
void CPooling::CommandControl()
{
byte data[16];
data[0] = 0xff;
data[2] = 0x34;
data[3] = 0 ;
data[8] = 0xfe;
cmd_list *pCommand;
POSITION pos1, pos2;
CString temp;
m_CS.Lock();
for (pos1 = sysinfo.cmdlist.GetHeadPosition(); (pos2 = pos1) != NULL;)
{
pCommand = sysinfo.cmdlist.GetNext(pos1);
if (pCommand->trial > 2)
{// remove
sysinfo.cmdlist.RemoveAt(pos2); //remove in list if trial > 3
delete pCommand;
}
else
{// read
data[1] = pCommand->moni_id;
data[4] = pCommand->port;
data[5] = pCommand->control;
data[6] = pCommand->priv;
data[7] = genChkSum(data, 6);
pCommand->trial++;
for (int i=0; i<9; i++)
{
p232->WriteComm(&data[i], 1);
Sleep(100);
}
//p232->WriteComm(data, 9);
Sleep(timeout);
}
}
m_CS.Unlock();
}
Once it return from this function, the program crash!!!
|
|
|
|
|
The code is pretty torn up, and the For-pos statment is missing the last half - I assume it's an empty statment, since the pos1 would be changed by the GetNext.
Try commenting out the delete pCommand and the RemoveAt lines and see if that changes anything. If not, then comment out the write to your serial port (I am assuming that is what your p232 object is). If that fixes it, then it's the code for that, not the loop.
"Perhaps the truth is less interesting than the facts?" -- Amy Weiss, RIAA's Senior Vice President of Communications. It's the new math! 421 == 156 !
|
|
|
|
|
hey! i tried to remark the serial port. and, It really work???
it is my fault or VC's debug mode having error? (it work in release mode!)
thanks,
jim
|
|
|
|
|
I have no idea - I don't know what the code in your serial port object looks like.
"Perhaps the truth is less interesting than the facts?" -- Amy Weiss, RIAA's Senior Vice President of Communications. It's the new math! 421 == 156 !
|
|
|
|
|
Check out: http://www.codeproject.com/debug/survivereleasever.asp
Adi
|
|
|
|
|
You are probably corrupting some memory location, and the memory you are corrupting happens to cause a crash in debug but not release mode.
e.g. possibly allocating 10 bytes and using 20, referencing a pointer that is not set or pointing to some random memory location. Peronaly I set all pointer to NULL when I declare them, to prevent this sort of thing happening.
Either bench test the code, or run it through a program like "Bounds Checker"
|
|
|
|
|
I just installed Visual C++ and wrote a simple program that would not compile. I know I have to set the path right, but it seems fine to me. Here's the code, error and path description. Contribute in anyway you can.
AIM: ezelame
//first c++ program
#include <iostream.h>
int main()
{
//cout << "Hello World!\n";
return 0;
}
error: c:\Documents and Settings\Eze Kamanu\My Documents\c++\test\first.cpp(8) :
fatal error C1010: unexpected end of file while looking for precompiled header directive
path: C:\Program Files\Microsoft Visual Studio .NET\Vc7\include;
|
|
|
|
|
king_ezela wrote:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Put cursor on error line. Hit f1. Read. Scratch head. Realize that you have failed to Read The Friendly Manual before starting. Do so. Go back and correct the totally bogus #include line. Try again, young jedi.
"Perhaps the truth is less interesting than the facts?" -- Amy Weiss, RIAA's Senior Vice President of Communications. It's the new math! 421 == 156 !
|
|
|
|
|
Dude, chill. The poster is new to Visual C, don't be a smartass when he's obviously struggling just to get started.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Looks like you're missing #include "stdafx.h" at the top of your .cpp file.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks a lot, it did work. Real dumb question, how do I run the program (see the output) after compiling?
|
|
|
|
|
Press F5
|
|
|
|
|
Since you are using Visual Studio.NET try the following:
#include "stdafx.h"
#include <iostream.h>
#using <mscorlib.dll>
#include <tchar.h>
using namespace System;
int main(void)
{
cout << "Hello World!\n";
return 0;
}
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
Hi Ezela, I see you got this particular problem solved, but please check out the Visual C++ forum FAQ (there's a link to it at the top of this page) that addresses other common compiling problems that you might encounter.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
it's obvious.
look at the #include line. you don't specify what to include.
it should be something like this
#include "stdafx.h"
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Hi:
I'm a newbie Visual C ++ programmer, and I'm trying to do a Simple chat using winsock.ocx, I have already done one in VB5 but now I would like to do it in VC.
Mainly, i'm having problems with .Connect metod, I don't understand what Const VARIANT &RemoteHost and Const VARIANT &RemotePort means.
PD: I have a chat example but it uses API and i would like to do it just using winsock.ocx.
Thanks and I hope you help.
This is the strangest life I've ever known.
|
|
|
|
|
RaulGonzalez wrote:
Mainly, i'm having problems with .Connect metod, I don't understand what Const VARIANT &RemoteHost and Const VARIANT &RemotePort means.
These parameters it is asking for is the "address-of" by the "&" sign for both the RemoteHost and the RemotePort variables being passed to the function. I would suggest that you read Andrew Peace's article on pointers. A Beginner's Guide to Pointers[^]
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
ok, I'm on it, thanks. Um, do you know where could i get a chat sample using winsock.ocx ? )
This is the strangest life I've ever known.
|
|
|
|
|
Sample code in C++ is probably going to use the APIs, since That's How It's Done in C++. (I don't even have winsock.ocx on my system, either)
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|