|
My software need to use MMC control and run on Windows7.
but when I try to register MCI32.ocx by bat file that include the code "@echo off regsvr32 MCI32.ocx" I've got some error
"The module "MCI32" was loaded but the call to DllRegisterServer failed with error code 0x8002801c"
I have used in Windows XP and never seen this problem before.
Please anybody help me to solve this problem.
|
|
|
|
|
I put "0x8002801c" into Google and a treasure trove of pages came up.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Please try to run the command prompt as "Run as Administrator" and then run the batch file.
|
|
|
|
|
This is regarding privilege to access Registry. The error code "0x8002801c" (Error accessing the OLE registry) says that you don't have write permission to the registry. You may have to run the bat file with high privilege, to do so run the bat file by right clicking on file and selecting 'Run as administrator' option.
|
|
|
|
|
|
I have a home-made app which performs fine, until the system is rebooted/restarted. Then I get the message "Ending program ... please wait", a timeout occurs, and then the app ends. As this is the only app which responds in this way, I assume that I have not coded the response to a system message which is causing the timeout. What system message is being sent and what response should be made to cause immediate termination ? Thanks in advance !
Doug
|
|
|
|
|
Not completely sure but maybe what you need is WM_QUERYENDSESSION[^] or WM_ENDSESSION[^]? This[^] here might also be useful to read.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
AFAIK a Windows app will get terminated automatically if it is a WinForms app (hence a message pump is active) with proper event handling (always responsive, so no long-winding event handlers), AND no extra threads are running in the foreground. If you need background activity, I recommend you mark your threads background ones, so they don't prevent app shutdown.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Found the "problem" ! (Embarresing really !) I wrote this app a long time ago and used a dialog-based MFC app but prevented the dialog appearing so that it effectively ran in the background. The main "routine" was in InitDialog() and effectively prevented messages being handled by the "window". Now create a thread in InitDialog(), let it complete, and hide the window in another way. WM_QUERYENDSESSION is now handled, and all works fine ! Thanks for your thought-provoking comments !!
Doug
|
|
|
|
|
I'm currently coding on a project where I need to post a user-defined message together with a LPCWSTR parameter.
But I don't know how to achieve that coz you know, PostMessage() only provides parameters typed as WPARAM and LPARAM.
Anyone could help?
Many thx in advance.
|
|
|
|
|
Cast[^] your string to LPARAM and do the reverse at the receiving end.
The best things in life are not things.
|
|
|
|
|
but be aware that if your string is transient ((new'd and delete'd) or stack based), it'll possibly be corrupt at the other end if you PostMessage it ...
|
|
|
|
|
I'm well aware of that. However, if the OP is not aware of casting then I doubt he'll be into something as advanced as new and delete .
The best things in life are not things.
|
|
|
|
|
barneyman wrote: but be aware that if your string is transient ((new'd and delete'd) or stack based), it'll possibly be corrupt at the other end if you PostMessage it ... How so? In order to pass strings from one thread to another using PostMessage() , new and delete are highly recommended.
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
|
Let's hope both the sending and receiving end is in the same process-space.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
guys, any clue if LZMA could be parallelized to be run in some way that makes it worth being run on a GPU rather than over a CPU?
The idea is to compress text.
Also: which would be better : ctw or lzma ?
thanks
|
|
|
|
|
Don't know much about compression algorithsm and somesuch but to make the GPU do things for you i would look into programmable pixel/vertex shaders, CUDA[^] and ATI Stream[^], maybe one of those can help you get started.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
thx man. There is already a bzip cuda project but none that uses LZMA
|
|
|
|
|
If it is opensource then i guess checking it out can help learn how you could use it for LZMA. Just note that -as far as i know- CUDA works only on (newer?) nVidia cards and ATI Stream on (also newer?) ATI cards, so if you write a CUDA-based LZMA compressor/decompressor, it won't work on a computer which has an ATI or some intel-integrated graphics system. Correct me if i am wrong though.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Makes lots of sense. Here its one sample ( regarding what you mean). I placed the words dot instead of the "." to avoid being considered spam
http://bzip2-cuda.github dot com/[^]
|
|
|
|
|
hi there i have discussed my problems about multi linked list thread
http://www.codeproject.com/Messages/3876300/implementing-multi-linked-list-correctly_.aspx
but i recognize that it coldn't solved. my problem was about implementing a multi linked list which your list implemented by more than one cases. for example by first name or last name. so it have two header and tail pointers. the adding and building the list operations are succesfully working. and there is not a problem when i delete a node by "first_name" and when i search him again, the output is "not found". but when i search him by his "last_name" (so i using header pointer of last name here) the output becomes "person exist". i hope i explain my problem understandable : ). so i appreciated if you can help me.
here is my structures
typedef struct node {
int birth_date;
int zipcode;
int phone_num;
char first_name[50];
char last_name[50];
char city[50];
char address[50];
char email_addr[50];
struct node* fn_next;
struct node* fn_pre;
struct node* ln_next;
struct node* ln_pre;
struct node* birdat_next;
struct node* birdat_pre;
} NODE;
typedef struct {
int fn_count;
int ln_count;
NODE* fn_head;
NODE* ln_head;
NODE* fn_tail;
NODE* ln_tail;
}LIST;
and here is the block i call adding functions for name and surname;
while ( !feof(myfile) ) {
NODE* pnew_stu;
if( !(pnew_stu = (NODE*) malloc(sizeof(NODE))) ) {
printf("ERROR NOT ENOUGH MEMORY!!!\n");
exit(100);
}
fscanf(myfile,"%s", &(pnew_stu->first_name) );
fscanf(myfile,"%s", &(pnew_stu->last_name) );
fscanf(myfile,"%s", &(pnew_stu->email_addr) );
fscanf(myfile,"%d", &(pnew_stu->phone_num) );
fscanf(myfile,"%s", &(pnew_stu->address) );
fscanf(myfile,"%s", &(pnew_stu->city) );
fscanf(myfile,"%d", &(pnew_stu->zipcode) );
add_fn_Node(list,pnew_stu);
add_ln_Node(list,pnew_stu);
}
and of course my add functions;
void add_fn_Node(LIST* list, NODE* pnew_stu) {
NODE* temp = list->fn_head;
if( list->fn_head == NULL ) {
pnew_stu->fn_next = list->fn_head;
pnew_stu->fn_pre = list->fn_head;
list->fn_head = pnew_stu;
list->fn_count = 1;
return;
}
else {
temp = list->fn_head;
if ( (strcmp( pnew_stu->first_name, temp->first_name )) <= 0 ) {
pnew_stu->fn_next = temp;
pnew_stu->fn_pre = temp->fn_pre;
temp->fn_pre = pnew_stu;
list->fn_head = pnew_stu;
list->fn_count++;
return;
}
else {
while ( temp->fn_next != NULL ) {
if ( (strcmp( pnew_stu->first_name, temp->first_name ) >= 0 ) && (strcmp( pnew_stu->first_name, temp->fn_next->first_name) < 0)) {
pnew_stu->fn_next = temp->fn_next;
pnew_stu->fn_pre = temp;
temp->fn_next->fn_pre = pnew_stu;
temp->fn_next = pnew_stu;
list->fn_count++;
return;
}
temp = temp->fn_next;
}
if ( temp->fn_next == NULL ) {
temp->fn_next = pnew_stu;
pnew_stu->fn_pre = temp;
pnew_stu->fn_next = NULL;
list->fn_tail = pnew_stu;
list->fn_count++;
return;
}
}
}
}
void add_ln_Node(LIST* list, NODE* pnew_stu) {
NODE* temp = list->ln_head;
if( list->ln_head == NULL ) {
pnew_stu->ln_next = list->ln_head;
pnew_stu->ln_pre = list->ln_head;
list->ln_head = pnew_stu;
list->ln_count = 1;
return;
}
else {
temp = list->ln_head;
if ( (strcmp( pnew_stu->last_name, temp->last_name )) <= 0 ) {
pnew_stu->ln_next = temp;
pnew_stu->ln_pre = temp->ln_pre;
temp->ln_pre = pnew_stu;
list->ln_head = pnew_stu;
list->ln_count++;
return;
}
else {
while ( temp->ln_next != NULL ) {
if ( (strcmp( pnew_stu->last_name, temp->last_name ) >= 0 ) && (strcmp( pnew_stu->last_name, temp->ln_next->last_name) < 0)) {
pnew_stu->ln_next = temp->ln_next;
pnew_stu->ln_pre = temp;
temp->ln_next->ln_pre = pnew_stu;
temp->ln_next = pnew_stu;
list->ln_count++;
return;
}
temp = temp->ln_next;
}
if ( temp->ln_next == NULL ) {
temp->ln_next = pnew_stu;
pnew_stu->ln_pre = temp;
pnew_stu->ln_next = NULL;
list->ln_tail = pnew_stu;
list->ln_count++;
return;
}
}
}
}
|
|
|
|
|
I'm sorry to say but the concept has been fundamentally flawed from the start. What you want is something that behaves like a single collection ("persons"), to which you can add and remove; and which you can iterate in a couple of ways (first name A-Z, last name A-Z, first name Z-A, last name Z-A).
So you should implement that as a single list, with the one ADD method and the one REMOVE method, not multiples of them. And your ADD, REMOVE and possible other methods should all take care of all the sort orders and links themselves all the time. So ADD should accept one new node and update all relevant link chains; REMOVE likewise.
As long as you don't do it that way, it will be open to abuse; as in your user calling add_fn_Node() and not calling add_ln_Node().
BTW: one more piece of advice. Assuming the nodes are small, I very much prefer not to have a LIST structure at all, I just use one more NODE item. That is, my list is a NODE, its next field points to the first node, and the forward link chain ends on the last node, which has a next value of null); likewise my list NODE's prev field points to the last node, and the backward link chain ends on the first node, which has a prev value of null. Doing it that way takes less code, as there are no special cases, a list never being empty! (it always contains itself, the list NODE, which you obviously have to skip when enumerating the real nodes).
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
well mate i guess i will do with your suggested way. one ADD and Remove function. hope i can do it in time. and for your last suggestion it is perfect!! but i have corner cases.
|
|
|
|
|
i agree with Luc
i'd do it the following way to get it done quickly
1. Maintain a naturally ordered list of all the items
2. Have an ordered list each for surname and firstname; these lists simply reference the index into the ordered list
Adding is cheap, iterating is cheap, finding is cheap (b-chop), removal is 'difficult'
Add - add item to back of natural order list, qsort the item index into each of the ordered lists
Remove - find the item in either sorted list, mark the item in the ordered list as dead - you can't delete it or you'll ruin the indices
ie
Natural Order (includes ALL item data)
Sarah Connor
Jack Black
Pete Jones
Stan Smith
Surname Order (just index into Natural Order)
1
0
2
3
Firstname Order (just index into Natural Order)
2
1
0
3
|
|
|
|