|
Whats your Operating system and computer that you run your program?
|
|
|
|
|
The OS is WinXP SP2,the version of the VC is the Visual C++ 6.0.
|
|
|
|
|
For VC6, there're several things you need to take into account. First thing is to always distribute a release version of your software. Then you need to make sure to distribute the dll's that your program depends on (you can use a tool called Dependency Walker to verify which dll's you need to distribute with your app).
Anyway, I don't think this is the problem (you would have got an error message). This typically happens when your application is using an ActiveX control that is not registered on the target machine. Are you using any specific ActiveX control ? If yes, make sure to distribute it with your app and to register it on the target machine.
|
|
|
|
|
Thank you.
Yes,just as you said,I used the ActiveX control as:DataGrid and Adodc.But I don't know how to distribute it with my app and how to register on the target machine.What should I do?
|
|
|
|
|
I think the easiest way is to use InnoSetup[^]. This is an installer with which you are able to register ActiveX controls during the installation.
|
|
|
|
|
Hi,
You may be having the MFC DLLs to support the EXE file.
This is because of the Operating system you are using.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Thank you.
I am just looking for the DLLs.Do you have the more useful method?
|
|
|
|
|
Use Dependency Walker & scan the executable.This will find out in case if you are missing any needed DLLs.
Regards,
Rane
|
|
|
|
|
I Need to access a File, where only One instance of an App has Read/Write Access, and where all other instances have read access only.
I First try to Open as Follows:-
m_hFile=CreateFile(FileName,GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_EXISTING,
FILE_FLAG_WRITE_THROUGH,NULL);
and designate some Internal State as MASTER.(i.e.: It can Change the File)
if I get a Share Violation, I try:-
m_hFile=CreateFile(FileName,GENERIC_READ,
FILE_SHARE_READ,NULL,OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS,NULL);
and Designate some Internal State as SLAVE. (it can only Monitor the File)
GetLastError reports a Share Violation when I try to open a second Instance, even though I only try to open it for reading.
What am I doing wrong.
Regards,
Bram van Kampen
|
|
|
|
|
According to the table here[^], if you first open the file
using
GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ
then subsequent opens need to use
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark,
Solved the problem. Btw, That's a usefull wee table! I've printed it off, and hung it above my desk.
Regards,
Bram van Kampen
|
|
|
|
|
Hello,
to identify local machines I need to read the Computer SID.
(like psgetsid.exe does)
Does anybody have a bit of source for this?
OS: Windows 2000 and up.
Compiler: VC9 using MFC (not C#). But I'll take anything you have even VB or Delphy
Mention: Computer SID, not a logon, user SID. Any computer have one. It don't need to be in a domain.
I searched hours in google and forums.
Thanks in advance
Stefan
|
|
|
|
|
From what I can find, the last 96 bits of
HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Account\V
is the machine SID.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
on my computer Vista, no domain, the hive \\hklm\security is complete empty
\\hklm\sam\sam is empty too
Stefan
|
|
|
|
|
You have to enable viewing - by default (even if you're
an administrator), you don't have read rights in the security
key. You can give yourself permissions in regedit however.
Anyway, I played around with this, and the following code
gives me the same SID found in that registry hive (on Vista):
DWORD SIDLength = 0;
DWORD RefDomainNameLength = 0;
SID_NAME_USE SIDNameUse;
::LookupAccountName(NULL, _T("MYCOMPUTERNAME\\"), NULL, &SIDLength, NULL, &RefDomainNameLength, &SIDNameUse);
PSID psid = (PSID)new BYTE[SIDLength];
LPTSTR domain = new TCHAR[RefDomainNameLength];
::LookupAccountName(NULL, _T("MYCOMPUTERNAME\\"), psid, &SIDLength, domain, &RefDomainNameLength, &SIDNameUse);
LPTSTR StringSid;
::ConvertSidToStringSid(psid, &StringSid);
::LocalFree(StringSid);
delete[] domain;
delete[] (BYTE*)psid;
Mark Salsbery
Microsoft MVP - Visual C++
modified on Saturday, August 30, 2008 11:45
|
|
|
|
|
Hello,
that looks great. I ignored LookupAccountName because, reading in the msdn, it should be only working with a PDC.
I try this out.
Thanks
Stefan
|
|
|
|
|
Can any body help?
I can successfuly write to the file,
but if I try to append it using the seek,
nomatter what parameters I pass, I always
get an assertion error.
my only soloution is to load the file contents
and then rewrite it fresh again, to get it working
oh dear, what a waste of resources, also my concern is,
from reading it and then writing it in this manor
if a number of users who use my software, there might be a chance
that when writing some recorded information will be lost
due to this manor
but my reckoning is that the file access spped is so fast
anyway that this shouldn't really matter. or does it?
looking for your expert opinion,
thanks
simon
|
|
|
|
|
simon alec smith wrote: ...I always
get an assertion error.
What line of what file is asserting?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
inet.cpp
line 918
yellow arrow pointed to ----> ASSERT(m_bReadMode);
|
|
|
|
|
So have you looked at line 918 of inet.cpp to see what condition is asserting?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
ASSERT(m_bReadMode);
I have no clue at all whats this line is doing
|
|
|
|
|
It is asserting that m_bReadMode is non-zero. Apparently it is not. How are you constructing the CInternetFile object?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
CInternetFile* pFile = (CInternetFile *)m_pFtpConnection->OpenFile("simon.txt", GENERIC_WRITE, FTP_TRANSFER_TYPE_ASCII);
|
|
|
|
|
Why the unnecessary cast?
Have you stepped into either of the CInternetFile constructors to see what m_bReadMode is being set to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi, Dave
I am quite fresh at this, how do I go about stepping into the
CInternetfile section
cheers
|
|
|
|