|
I want to hide a tab from the property sheet based on the user's access role. Can this be done?
Elizabeth
|
|
|
|
|
CPropertySheet::RemovePage
CPropertySheet::AddPage
|
|
|
|
|
I'm trying to move values in an array downwards.
This is just example code and I can't make it working:
char** t = new char*[5];
void move();
void print_data();
int main()
{
char* e1 = "one";
char* e2 = "two";
char* e3 = "three";
char* e4 = "four";
char* e5 = "five";
t[0] = e1;
t[1] = e2;
t[2] = e3;
t[3] = e4;
t[4] = e5;
print_data();
std::cout << "------------------------\n";
move();
print_data();
delete [] t;
return 0;
}
void move()
{
for(int i = 5; i >= 0; i--)
{
char* temp = NULL;
if(i == 0)
temp = nada;
else
temp = t[i-1];
t[i] = temp;
}
t[0] = "new value at first position";
}
void print_data()
{
for(int i = 0; i < 5; i++)
std::cout << i+1 << " -> " << t[i] << "\n";
}
When the program tries to delete t it crashes with this debug info:
DAMAGE: after normal block (#bla bla) at 0xbla bla.
Well, I guess it's useless but how can I solve this?
And please, don't ask why I'm doing this
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Rickard Andersson18 wrote:
char** t = new char*[5];
this is a RUNTIME statement, defined static. i think this doesnt work!
put it in the main function!
Don't try it, just do it!
|
|
|
|
|
I've changed it, and tried it, it still gives me the same error as before.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
WRONG. That is a perfectly valid thing to do. It simply happens during initialization of other global items.
Software Zen: delete this;
|
|
|
|
|
The statement char** t = new char*[5]; allocates 5 elements (0 - 4). However, your for-loop is starting at 5. Your assigning data out of the bounds of your array and therefore overwriting (damaging) adjacent data on the heap.
Either change your for loop to i=4 or extend your array to 6 elements.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Check that for loop: looks like you are making 6 iteratons instead of allocated 5:
for(int i = 5; i >= 0; i--)
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
After I have replace the default constructor from the property page class with a constructor having an input caption variable, I am not able to get back to the class wizard on this class. The IDE displays a message: A duplicate insert block exits for class "CInboxPropPage" in the source file (InboxPropPage.cpp, InboxPropPage.h).
However, there is no compilation error. How can I fix the problem so I can still get to the class wizard to add more event handling functions and memory variables?
Elizabeth
|
|
|
|
|
I got it fixed myself. I removed the lines from the old constructor. I guess even I commented them out, the class wizard still treats them as regular code for example //AFX_DATA_INIT was appearing in two places, one at the old(replaced) constructor, and one at the replacing constructor.
Elizabeth
|
|
|
|
|
Hi world;
Anybody know how to display a YUV (or YCrCb) 16 bits image format?
Because I grab image from a PAL-M camera and the image format is 16 bits YCrCb...
I use the GDI! Currently I can dispay B&W (8 bits) and RGB format (32 bits) from others cameras without problems...
Thanks for your help...
Hello World!!!
from Raphaël
|
|
|
|
|
Raphaël Kindt wrote:
Anybody know how to display a YUV (or YCrCb) 16 bits image format?
See if this site helps any:
http://www.wotsit.org/search.asp?page=10&s=graphics
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I am developing an attributed ATL COM component in VC 7.0. Everything works fine until I add a web reference. When I add a web reference to some webservice (created in Java), the BUILD process of ATL COM component generates following error while performing registration.
Performing registration
Project : error PRJ0019: A tool returned an error code from "Performing registration"
The point is that if I make the same ATL COM component without using Attributes, the BUILD process returns no error even after adding the web-reference to the web service.
Could anyone be able to help me out in resolving this issue ?
Regards,
Arun
|
|
|
|
|
When using the multiple select option with CFileDialog to get mutlple files, there is a size limit of 32K. If there are more files selected, some are lost no matter how big the buffer size you provide. THis is a problem when selecting a large number of files since no warning is given about some files are not included. The limit is actually set by the GetOpenFileName call.
Has anyone found a solution to get around of this problem?
Thanks
|
|
|
|
|
Use Windows 9x/Me and there is no restriction. Also using Unicode on Windows 2000/XP and there is no restriction. Other than that, the 32KB limit is it.
I'm curious if that is really a problem for you. Even if every filename was maxed out at 256 characters, that would yield room for 128 of them.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
It's not a common problem but an annoying problem for us.
We deal with large 3D medical images, each set can have more than
800 files where each file has filename easily longer than 128 chars.
While it's true some platforms don't have the limit, we don't
have the option to ask the user to choose certain windows to
run. Of course, you run into other problems on Windows 9X, where
the maximum size of memory you can allocate is 256MB. Not good
for processing large size CT images.
Thanks
DavidCrow wrote:
Use Windows 9x/Me and there is no restriction. Also using Unicode on Windows 2000/XP and there is no restriction. Other than that, the 32KB limit is it.
I'm curious if that is really a problem for you. Even if every filename was maxed out at 256 characters, that would yield room for 128 of them.
|
|
|
|
|
Check out CodeProject code section.
http://www.codeproject.com/dialog/pja_multiselect.asp
Kuphryn
|
|
|
|
|
Thanks for the link, it solved the problem beautifully!
kuphryn wrote:
Check out CodeProject code section.
http://www.codeproject.com/dialog/pja_multiselect.asp
|
|
|
|
|
Please help me how I get sound from microphone and record it to file and analysis it(amplitude,frequenceand volume)inVirtual c++ Thank you
nattapolaoun
|
|
|
|
|
I'm fed up with this newbie sh*t... oh please internet, show me how to code!
IT'S NOT VIRTUAL C++, IT'S VISUAL C++!!!
go away if you don't know anything about programming! good bye!
Don't try it, just do it!
|
|
|
|
|
<rant>
Unfortunetaly for you, you're my luck winner in the "pick on someone who has asked a homework question in the forum" contest.
OK.. first off: it's VISUAL c++. Secondly, why the hell is the thread called "Direct x"? Thirdly, have you done ANY kind of searching on your own on this topic? Maybe used Google? Perhaps, before you come here hoping that someone will write your homework for you, you actually go out and try to something on your own? Fouthly, i think it's same to assume that you have not written any code at all. Fifthly, why not just ask us to mow your lawn and take out your garbage for you while you're at it?
Now, after you have done some searching, some coding, and some debugging of your own, and you STILL have trouble getting something to work, maybe *then* come here and say "i'm not sure what i need to be doing here, can someone point me in the right direction?". (don't make it a bug-hunt either: people hate that).
</rant>
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know...
[Nitron]
|
|
|
|
|
6th: people hate it, when some1 is just registering on CP, to exploit the forums and ask his silly questions! (he registered less than a month before and this is his first post)
THIS IS A COMMUNITY, NOT A FREE INFORMATION SERVICE CENTER!
Don't try it, just do it!
|
|
|
|
|
as tested, if creating name-less event - CreateEvent(0,0,0,0) - in both client and server sides (2 applications in same PC), when client SetEvent, server side can not receive the event.
my Q is:
why use name-less event and how does it work (in which case)?
thx
includeh10
|
|
|
|
|
Typically you use an unnamed event to communicate between two threads in the same process. In this case, you only call CreateEvent once, storing the event handle in some well known location.
You can also use DuplicateHandle to open a new handle to a handle you do know about that lives in another process. You might use some form of interprocess communications (window messaging, shared memory, RPC) to tell one process about the other process's event handle.
However, you can never reopen an existing unnamed event object using CreateEvent - you always get a new one for each call.
|
|
|
|