|
Thanks for the help. I think I might try to use a java applet image viewer that can constantly ask for updates from the ISAPI dll and display the generated raw image data. Hopefully that will limit the amount of Java I need to learn but still get the job done.
|
|
|
|
|
I am very new to creating Windows DLLs and I am trying to create a plugin for iTunes but I need this plugin to have a window that runs alongside iTunes. When I open iTunes it does create the window but I get "Unhandled exception at 0x10911758 in iTunes.exe: 0xC0000005: Access violation reading location 0x10911758."
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(_T("iTunesLyrics"));
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH: InitWnd(hInstance); break;
case DLL_THREAD_ATTACH:
case DLL_PROCESS_DETACH:
case DLL_THREAD_DETACH:
break;
}
return true;
}
int InitWnd(HINSTANCE hInst)
{
static TCHAR szAppName[] = TEXT("iTunesLyrics");
MSG msg;
WNDCLASSEX wndclass;
wndclass.hIcon = LoadIcon(0,IDI_EXCLAMATION);
wndclass.cbSize = sizeof(WNDCLASSEX);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = (WNDPROC)WindowProcedure;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInst;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = _T("Testing");
wndclass.hIconSm = NULL;
if(!RegisterClassEx(&wndclass))
MessageBox(NULL, _T("RegClass Failed"), _T("Error"), MB_OK);
hWnd = CreateWindow(_T("Testing"), _T("This is a test"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInst, NULL);
ShowWindow(hWnd, SW_SHOW);
return 0;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY: PostQuitMessage (0);
break;
case WM_CREATE: return 0;
break;
case WM_NCCREATE: return true;
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
Any help would be greatly appreciated.
|
|
|
|
|
I can't tell from the code where the problem lies, but this is caused by memory trying to be used without being initialized first. How are you debugging your DLL? Are you just compiling and then running iTunes to load it? If so, you should try launching iTunes from within the dev environment so that you can see at what point the dll if failing. If you're using VS, under your project properties there is a 'Debugging' tab and a 'Command' argument. You can place the path to iTunes.exe in here and it should launch iTunes when you run your program. It probably needs some command arguments in order to load your dll, but you will have to consult the iTunes documentation for that.
Not sure how helpful this is. If apple has an SDK there is probably more info on the message boards for it.
Dustin
|
|
|
|
|
The Way I debug is I try to open iTunes after putting the compiled dll into the plugins folder a Visual Studio Just in Time Debugger pops up and gives me the option of using visual studio to debug so I click yes and that is when I get the violation reading location error.I tried adding iTunes.exe to the debugging tab but it says debugging information cannot be found or does not match. Unfortunatly I was not able to find any information for any arguments to put in for the debugger. Also I have not been able to find an iTunes debugging message boards either...
|
|
|
|
|
My application stores its settings in an XML file on user's PC. But the data inside the xml file can be easily read and changed by anyone who can see that file. I want to lock that file so that no one can open that file except my application.
Is there any way to achieve this without encrypting/decrypting whatever I dump into file?
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
Locking alone will not do the job. If a file is on my system then I can view it. Period. Your best best is encryption in such a case.
Saurabh
|
|
|
|
|
Can you add an ACE to the file's ACL?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Suppose, I add write restriciton for the user but won't that restrict my application too from writing to that file?
I am yet to look into this.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
If access to your file was limited to a certain user, then you could run your program as that user. I've not done this before so it may or may not work for your situation.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello
I have problems with a few "things" and "circumstances" and so need help.
Prologue:
many years ago i learned to create progs in C, later on I tried a bit of "C++",
but i never left my pc-environment. Now, i had to send data to a server - that's
very exciting for me - especially cause i don't know the basic "terms" and "procedures".
Perhaps someone can explain me the following problems:
Problem:
1. Get data out of my existing programm and create a xml-file.
2. Include additional files in this xml-file (like jpg's) and code it in base64-manner.
3. Send this file to a server
4. Get an answer from this server ...
5. ...and work with it further more in my prog.
The items 1, 2 and (soon, i hope)5 are solved, but i can't understand the mechanism of
"talking" to a server out of my c-programm???? I never had to do this in the past,
i'd always opend lokal files or databases via ODBC or other lokal things. When i had to send
files to a server, i used a ftp-software on my desktop, but I have never done this from my code...
I've got a documentation from the server-admin, which tells me the following:
1. create a xml-file, insert all the stuff which is needed and then "...name it xmlpackage..."
what is this? - no extension (perhaps xml) for a file? for me, it seems "unusual" but this
isn't the "real problem" - this looks like a "wrong behaviour" to me...
2. then, use the following address to send the data:
https://www.theservername.com/XML/interface.php?postTheNewData
what does this mean? Is this the adress i had to send my file to?
but: is it right, that the expression after the questionmark is a parameter? so why is it
called "postTheNewData" and not "xmlpackage" like a few lines above?
3. i used the function WpPost of the mfc to try sendng files, and the wizard asked me a lot
of things and at the end - an error occured....(and my file isn't send)
4. and this is only the sending -part - what shall i do for retrieving new data?
Additional Question:
Is it possible to send and retrieve data with the mfc and without using third-party-programms?
How can i get a response after sending - if the sending is ok or not?
Perhaps, someone can help me out of this situation, because after i asked the admin in the
past, the only answer i've got from him, is: "...in every programming - language must be
a function to post data to a server, but i can't help you now - good luck..."
So please, be patient with me. I dont know someone to ask for, so i contact this group because i
will code the answer in "c/c++".
Thanks a lot for an quick answer.
|
|
|
|
|
fish4fun wrote: 2. then, use the following address to send the data:
https://www.theservername.com/XML/interface.php?postTheNewData
what does this mean?
HTTPS is Secure Sockets over HTTP
http://en.wikipedia.org/wiki/HTTP[^]
http://en.wikipedia.org/wiki/Https[^]
fish4fun wrote: Is this the adress i had to send my file to?
It appears so.
fish4fun wrote: Is it possible to send and retrieve data with the mfc and without using third-party-programms?
Yes it is. There are several ways, one might be to use the WinInet classes like CInternetSession[^]
fish4fun wrote: How can i get a response after sending - if the sending is ok or not?
It depends. Learn HTTP then ask more questions.
fish4fun wrote: Perhaps, someone can help me out of this situation, because after i asked the admin in the
past, the only answer i've got from him, is:
After you get more knowledge of HTTP and HTTPS perhaps you can ask more specific questions of the admin and he will be able to supply the answers you need.
led mike
|
|
|
|
|
Wow....downvoted for that? Brutal
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sorry, if i used the wrong button!
That was a very good answer, because it was quick and an answer!
|
|
|
|
|
In addition to led mike and CPkid's replies...
For working with XML:
XML Processing Options[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I should probably change my CP name to downvoted
led mike
|
|
|
|
|
May as well - that's what I call you :P
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
See if this link helps.
It should answer some of your questions related to HTTP.
Even I am new to all this and I also went through this code in the morning and it was indeed very helpful to me.
Hv a nice day.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
When I add a new button and want to add a even of the button by double clicking it.
But it appear the error message as below:
Add/Remove operation is impossible, becuase the code element CDialogCommon is read only
How do I solve it?
|
|
|
|
|
I get this sometimes.
All I do is close the solution and open it again.
Then it seems to work.
If not check if the files are actually read only.
« Superman »
|
|
|
|
|
I am calling a function in a thread that contains an infinite while loop and I want to stop that loop and as well as kill/exit thread on some condition.
Can anyone please tell me how to do that?
Regards,
Mushq
|
|
|
|
|
TerminateThread will do the job, if you're not concerned about cleanup/releasing of resources.
BOOL WINAPI TerminateThread(
__inout HANDLE hThread,
__in DWORD dwExitCode
);
|
|
|
|
|
Bad advice. See here[^] for details (the documentation also warns against using it).
Steve
|
|
|
|
|
I think its second times that somebody told about use of TerminateThread and you reply to him or her why its bad with a link.
|
|
|
|
|
Yeah, That sounds about right. It's one of those classic mistakes that even "professional" programmers make over and over again.
Steve
|
|
|
|
|
I personality like to read your replys because they arecomplete and helpful.
|
|
|
|