|
see the Version component in the resource tab
|
|
|
|
|
I am using VS.NET 2005 to build a Windows Form Application (not MFC). I found a ACL editor program from codeproject.com which I want to incorporate in my application. It has two dll files, FilePermsBox.dll and FilePermsBox.Interop.dll
In section "16. FilePermsBox API" of the article http://www.codeproject.com/win32/accessctrl4.asp, it was mention that the author has rewritten wrappers to allow the program to be called using OLE automation.
I have little knowledge on OLE automation and hence I just tried adding FilePermsBox.Interop.dll as references. This allow me to compile the following code.
array<string^>^ fCollection = gcnew array<string^, 1="">{"C:\test.txt"};
ManagedSecurityBoxWrapper::IManagedSecurityBoxWrapper^ sb = gcnew ManagedSecurityBoxWrapper::ManagedSecurityBoxWrapper();
sb->FileNames = fCollection;
sb->COSecurityBox1(false);
However during runtime I will encounter the following error when ManagedSecurityBoxWrapper constructor is invoked.
An unhandled exception of type 'System.TypeInitializationException' occurred in System.Windows.Forms.dll
Additional information: The type initializer for '<module>' threw an exception.
Is there anything else I need to add in project properties to use it or can someone enlighten me on how to use OLE automation to call this API. I will be more than grateful if someone is willing to download the dlls from codeproject.com under the link
http://www.codeproject.com/win32/accessctrl4/filepermsbox111.zip[^]
and try it out, letting me know whether this is even possible. Thanks a million!
|
|
|
|
|
Hi guys, i am totally new to C programming and i just came over a simple problem which i couldn't solve because i'm not have basic in programming but love to learn it.
this is what surrounded me...
1) A sequence of number, e.g 1120060002600000000790123904122006 (34 digits)
2) i need to view just certain slots of digit from 7th-12th as a record
3) Then from 13th-26th as a values. This getting worse when it come miscounted the numbers.
4) do anyone know how to solve this and kindly can come up with simple code which could read the input and just display the outputs in slots of digits.
5) i am sick of this things.
love it but hardly to own it
-- modified at 4:06 Thursday 18th January, 2007
|
|
|
|
|
chks wrote: 1) A sequence of number,
2) i need to view just certain slots of digit from 7th-12th as a record
3) Then from 13th-26th as a values. This getting worse when it come miscounted the numbers
What is a record (in this context)?
What are values (if not numbers)?
How could you possibly find out if the numbers are miscounted?
If you could find out, could you do anything about it other than rejecting the whole string?
Do you really have to use C, or could you use C++? Or a .NET-Language?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks jhwurmbach for replying,
1) as an example there is, ABCDEFGHIJKLMNOPQ
then, from this alphabet, i just need to view DEFG only a record
2) The values are actually the numbers in that sequenced directly.
3) Miscounted, maybe, miswatched such as supposed to be DEFG but CDEF.
4) It seems i'm doing it manually now. perhaps, C is better for newbie like me.
|
|
|
|
|
chks wrote: 1) as an example there is, ABCDEFGHIJKLMNOPQ
then, from this alphabet, i just need to view DEFG only a record
2) The values are actually the numbers in that sequenced directly.
3) Miscounted, maybe, miswatched such as supposed to be DEFG but CDEF.
4) It seems i'm doing it manually now. perhaps, C is better for newbie like me.
Re: 4) Do you really think that C as opposed to C++, C# or even VisualBasic is the right language to start? Do you have read any beginners literature about C?
So, you got a string consisting of your digits or letters.
In C, that would be a char* (or a wchar_t* if you have Unicode).
You can now use the C-Runtime (short CRT) string manipulation (as described in every C-beginners guide or even in the MSDN) to extract the parts you want.
Here, you could add 3 to the pointer and then use strncpy (or wcsncpy in unicode) to copy the next 4 characters, giving you "DEFG".
About the miscounting, you need to define the rules on which you can determine if there has miscounting occured.
Something like:
"Too short",
"There MUST be a '-' at position 7",
There can only ever be a '0' at position 3".
These rules you can check.
So, go ahead and try!
If you have produced some source you may come back and present it here.
--fixed typos and formatting
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
chks wrote: 1) A sequence of number, e.g 1120060002600000000790123904122006 (34 digits)
2) i need to view just certain slots of digit from 7th-12th as a record
char *pSequence = "1120060002600000000790123904122006";
char szRecord[7] = {'\0'};
strncpy(szRecord, &pSequence[6], 6);
chks wrote: 3) Then from 13th-26th as a values.
char szValue[15] = {'\0'};
strncpy(szValue, &pSequence[12], 14);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
main()
{
char *pSequence = "1120060002600000000790123904122006";
char szRecord[6] = {'\0'};
strncpy(szRecord, &pSequence[6], 6);
/*printf("\n%d\t",szRecord); actually the output should be 000260 but 2293584 */
char szValue[15] = {'\0'};
strncpy(szValue, &pSequence[13], 14);
/*printf("%d\n",szValue); actually the output should be 00000007901239 but 2293568*/
}
sorry, i am very new to C,and trying to learn it
|
|
|
|
|
chks wrote: /*printf("\n%d\t",szRecord); actually the output should be 000260 but 2293584 */
Use %s with strings, and %d with integers.
printf("\n%s\t", szRecord);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey guys,
I am using this code to convert the data into string
CryptBinaryToString((BYTE *)pBufPtr,len,1,msg2,&lul_buflen);
The msg2 looks like
"KBeMW9yLvHwMow5dKCXO3ddKLzIGQTmbtNVmmFF2FmT9/f39q6urq6urq6vu/u7+"
and I am using the following functions to convert the string to long so that I can reduce the size to be displayed on the string
char *p;
long l = strtol(msg2, &p, 10);
long temp1 = atoi(msg2);
But both of them return 0 as the value.
Please help.
vg
|
|
|
|
|
Uuh ?? This doesn't represent a number ! There are letters in it, how could this be translated to a number ?
The functions will stop as soon as a non numerical symbol will be detected, in this case this is the first one (K), so the functions return 0.
Why do you want to reduce its size and why do you want to convert it into a number ??
|
|
|
|
|
Basically I the encrypted binary data I want to convert to a string and display it as a challenge to the user who can read it out to the admin user who can use that challenge to create the response.
So I need to convert that string into a decent size number or maybe string itself is fine that can be displayed to the user.
Thanks.
vg
|
|
|
|
|
Well, once you get the encrypted string, you cannot reduce it any further (and even not change it). So your problem is before, already at the encryption.
And I don't know how you can change the size of the encrypted string.
|
|
|
|
|
The string in your OP is a representation of the encrypted data, it's base-64 encoded. You'll need to be more precise about what you mean by "convert that string into a decent size"
|
|
|
|
|
What I mean by that is say the entire string is of 25 size I need to conver that to 10 or maybe less so that when it is displayed on the screen to the user, the user can take that string and read it out to Admin. Hope this makes it clear. Thanks.
vg
|
|
|
|
|
If you want a shorter human-readable string, you'll need to have less encrypted data.
|
|
|
|
|
vgandhi wrote: Basically I the encrypted binary data I want to convert to a string and display it...
So just display it in encrypted format (i.e., string).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
My friend how can I display it in encrypted format to the user. The user won't understand anything.
vg
|
|
|
|
|
vgandhi wrote: My friend how can I display it in encrypted format to the user. The user won't understand anything.
This makes no sense. The whole purpose for encryption is so that "it" is not understandable.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
why do i get an error with this source code? pls help me..im new to programming
///////////////////////////////////////////////////////////
// lpszPathName - Pathname of file
// pSound - Pointer to sound buffer
// cbSound - size in bytes of sound buffer
// pWfx - pointer to WAVEFORMATEX structure
// cbWfx - size of this structure
BOOL SaveWAVFile(LPCTSTR lpszPathName, HPSTR pSound, LONG cbSound,WAVEFORMATEX pWfx, LONG cbWfx)
{
MMIOINFO mmioinfo;
MMCKINFO ckRIFF;
MMCKINFO ck;
HMMIO hmmio;
::ZeroMemory(&mmioinfo,sizeof(mmioinfo));
hmmio = mmioOpen((LPSTR) lpszPathName,&mmioinfo,MMIO_WRITE|MMIO_CREATE);
if (hmmio == NULL)
{
TRACE("mmioOpen returns NULL\n");
return FALSE;
}
// Creating 'RIFF' and 'WAVE' chunks
ckRIFF.fccType = mmioFOURCC('W', 'A', 'V', 'E');
ckRIFF.cksize = 0L;
ckRIFF.dwFlags = MMIO_DIRTY;
mmioCreateChunk(hmmio, &ckRIFF, MMIO_CREATERIFF);
// Creating 'fmt ' chunk
ck.ckid = mmioFOURCC('f', 'm', 't', ' ');
ck.cksize = 0L;
ck.dwFlags = MMIO_DIRTY;
mmioCreateChunk(hmmio, &ck, 0);
mmioWrite(hmmio, (HPSTR) pWfx, cbWfx);
// Goto to 'WAVE' chunk and update 'fmt ' chunk size
mmioAscend(hmmio, &ck, 0);
// Creating 'data' chunk
ck.ckid = mmioFOURCC('d', 'a', 't', 'a');
ck.cksize = 0L;
ck.dwFlags = MMIO_DIRTY;
mmioCreateChunk(hmmio, &ck, 0);
mmioWrite(hmmio,(HPSTR) pSound,cbSound);
// Goto to 'WAVE' chunk and update 'data' chunk size
mmioAscend(hmmio, &ck, 0);
// Goto to 'RIFF' chunk and update 'WAVE' chunk size
mmioAscend(hmmio, &ckRIFF, 0);
mmioClose(hmmio,0);
}
|
|
|
|
|
killer fria wrote: why do i get an error with this source code?
When you have an error, it would be nice to explain exactly what the problem is. I have an error is very vague and doesn't give any clue about what the problem could be. Compile error ? Linker error ? Run-time error ? And describe exactly the error.
And also, use the code tag (above the emoticons) whenever you need to post code otherwise your code is almost unreadable.
|
|
|
|
|
oh im sorry.it was just my first time to join forums like this. anyway the error that im referring to is an unexpected end of file while looking for pre compiled header directive.
i dont know what header i will use for this program.
here's the code..
<br />
<br />
<br />
BOOL SaveWAVFile(LPCTSTR lpszPathName, HPSTR pSound, LONG cbSound,WAVEFORMATEX pWfx, LONG cbWfx);<br />
{<br />
MMIOINFO mmioinfo;<br />
MMCKINFO ckRIFF;<br />
MMCKINFO ck;<br />
HMMIO hmmio;<br />
<br />
::ZeroMemory(&mmioinfo,sizeof(mmioinfo));<br />
{<br />
hmmio = mmioOpen((LPSTR) lpszPathName,&mmioinfo,MMIO_WRITE|MMIO_CREATE);<br />
<br />
if (hmmio == NULL) <br />
{<br />
TRACE("mmioOpen returns NULL\n");<br />
return FALSE;<br />
}<br />
<br />
ckRIFF.fccType = mmioFOURCC('W', 'A', 'V', 'E');<br />
ckRIFF.cksize = 0L;<br />
ckRIFF.dwFlags = MMIO_DIRTY;<br />
mmioCreateChunk(hmmio, &ckRIFF, MMIO_CREATERIFF);<br />
<br />
ck.ckid = mmioFOURCC('f', 'm', 't', ' ');<br />
ck.cksize = 0L;<br />
ck.dwFlags = MMIO_DIRTY;<br />
mmioCreateChunk(hmmio, &ck, 0);<br />
mmioWrite(hmmio, (HPSTR) pWfx, cbWfx);<br />
<br />
mmioAscend(hmmio, &ck, 0);<br />
<br />
ck.ckid = mmioFOURCC('d', 'a', 't', 'a');<br />
ck.cksize = 0L;<br />
ck.dwFlags = MMIO_DIRTY;<br />
mmioCreateChunk(hmmio, &ck, 0);<br />
mmioWrite(hmmio,(HPSTR) pSound,cbSound);<br />
<br />
mmioAscend(hmmio, &ck, 0);<br />
<br />
mmioAscend(hmmio, &ckRIFF, 0);<br />
mmioClose(hmmio,0);<br />
}<br />
|
|
|
|
|
git crunk wrote: anyway the error that im referring to is an unexpected end of file while looking for pre compiled header directive
Well, that would have been impossible to determine by the code snippet you posted . So, from now on remember to be extremely specific whenever you ask a question.
To correct the problem, simply add #include "stdafx.h" at the top of your .cpp file (and before all other include directive, otherwise it won't work).
Remember to do that in all the cpp files you create.
Another option is to disable the precompiled directive. You can go in your "project settings", "C/C++", "Precompiled headers" and there you should find an option to disable the precompiled header (I'm not totally sure of the way to access it but it should give a good idea of where to find the setting)
|
|
|
|
|
hi !
i have created a function below to check the whether the file is created on that particular drive.
but gives INVALID_HANDLE_VALUE .
<CODE>
void _FilePersistandata()
{
HANDLE hFile = INVALID_HANDLE_VALUE;
hFile=CreateFile ( L"c:\FileProperty.XML"
, GENERIC_READ | GENERIC_WRITE
, 0
, NULL
, OPEN_EXISTING
, FILE_FLAG_NO_BUFFERING
, NULL
);
if(hFile == INVALID_HANDLE_VALUE)
{
MessageBox(0,_T("File is not created"),_T("Create File"),0);
}
else
{
MessageBox(0,_T("file has been created"),_T("Creat File"),0);
}
}
</CODE>
|
|
|
|
|
amitmistry_petlad wrote: hFile=CreateFile ( L"c:\FileProperty.XML"
You missed a escape sequence here. i.e. L"c:\FileProperty.XML" should be L"c:\\FileProperty.XML" .
|
|
|
|
|