|
I take it your tryig to set the baud rate through a DCB structure and the BaudRate member.
Ar eyou setting it like this:
dcb.BaudRate = 76800;
The other issue could be that some of the othere DCB parameters are not filled out correctly.
If you vote me down, my score will only get lower
|
|
|
|
|
Hello Roger,
Thanks for your response. Yes i'm setting the baudrate and other configuration parameters of serial port using DCB structure only with SetCommState() Function.
so when i use baudrates like 76800, the return value of SetCommState() function is INVALID_PARAMETER. So i want to know if anyone has done something to achieve this kinda baudrates configured with serial port for their requirements.
Thanks
Adi
|
|
|
|
|
Some systems (drivers) have a list of accepted baud rates, I'm not sure if that could be your problem. Certainly on standard PC serial ports the hardware only allows a limited selection of baud rates and the driver will reflect this.
Elaine
The tigress is here
|
|
|
|
|
yeah it's true there are limited which driver supports which is documented in the header ntddser.h file. The hardware support depends on the highest speed of the hardware (till 1990s the speed was 115.2 k, after 2000's it's become more than that like 230K, 430K etc.....).
The baudrates that are supported by the drivers are derived from the devisors of the highest speed.(Ex:115.2k - devisor 1,57600-div2,38400-div 3 ..etc).
So i'm looking for what can be done to achieve the baudrates (such as 76800) which are exact divisors of the highest speed(incase of 115.2k) also.
Please let me know if you know any leads on the same.
Thanks for your info sharing
Adi
|
|
|
|
|
Hello, I have a serious problem because i want to do a application that sends to other application the permisions that this application will have. But my problem is how can i do it and when i send the permission how can i lock the files to protect my computer.
Thank you very much
|
|
|
|
|
densitet wrote:
i want to do a application that sends to other application the permisions that this application will have
Uhhh.. what does that mean ??? What do you mean by permissions ?? And which other applications ??
densitet wrote:
when i send the permission how can i lock the files
Which files ???
Maybe I'm completely missing the point but I really don't understand what you want to do. Try maybe reformating your question a little bit clearer.
|
|
|
|
|
Ok, thank u for answer. I will try explain better. We can say that I have a client and a server running in the same machine where the client send information to the server to authentication, so when the server authentice this information, it should be to know to which files has permiss, for example if i am "densitet" and im authenticated the server should be to know that i have only permisses to pdf files. But i dont know how can i store the information of the different users in the server (lists, bbdd, text files...), because i want that for example like in the windows XP i want to have users with all rights, users that only access a doc files,.... And when the server know that i have permissions to doc files for exmaple i want to block the rest of the files.
Thank you very much.
|
|
|
|
|
Ok, this is a little bit clearer. But it's not really my field but I will try to help you. But at least, this is also clearer for the other people here .
In fact, you just want to know how you will store the permissions ? Why don't you store that in simple ini files (text). Something like that:
[Densitet]<br />
Allowed=doc,txt,pdf<br />
<br />
[...].br />
Allowed=txt<br />
<br />
... and so on
Then to read the file you can use this[^] if you use the MFC.
I don't know if that answer your question ? And also, I don't know if it's the good solution....
|
|
|
|
|
Ok, thank you very much, Now i know how can i store the information and handle the extension of the files with the different users. But One duda more for example is if I want that Densitet only have access to the folder Program files or access to 30 files with different extensions in different folders. And when u have controlled this situation, for example if the user create a new file, how can i send the information of the file that the user is creating to the server to actuallize the bbdd.
Thank you very much for the help, I hope that u understand this kind of problem i don't know if i have explained good, i hope so.
/Densitet
|
|
|
|
|
densitet wrote:
One duda more for example is if I want that Densitet only have access to the folder Program files or access to 30 files with different extensions in different folders.
Err.. I don't know. But what is your program doing exactly ?? What do you mean by 'people have access to file' ?? What are you implementing ? A kind of windows explorer or what ?
Then it is just up to your program to decide what to do with specific users...
|
|
|
|
|
My program like i told u, has a client and a server in the same machine, but when i entry in the windows XP with the users i want create like different permissions to the users like WXP has Administrator, Invite, .... I want to do that each user has different permissions, for example Densitet only permiss to 30 names of files, Other user permission to only 2 files, something like that, Can i store this information like u say me with a ini file and in allowed write the name of files?, and when the user create a new files how i can send this file to the server to actualize the ini file?. And when the server send the permission to the client, the client will permit to the user access to this files and not to the other files. I want to know how can i handle this.
I hope that my explication will be better than before.
/Densitet
|
|
|
|
|
Hi,
I am facing one problem.I am reading .res file and writing contents to xml file.Here in one function i am writing one for-loop for reading areas of image upto area is null,but now i want to add another element into xml file.
so i am adding one another for- loop but when my 1st loop completes and second for-loop starts then immediatly i got error message that unhandled exception in res2xml.exe : 0*C0000005 : ACCESS violation.
i had checked this exe file and i had given all rights to it.
Now can anybody tell me that what is the main problem?
|
|
|
|
|
You don't have this message because you don't have access to the file ! This is the res2xml.exe program that raises this error because it tries to read or write somewhere in memory where it was not allowed to. So, use your debugger (F5) and see exactly which instruction causes this error.
|
|
|
|
|
Hi,
I had done after debugging my code ,the main problem is that when i am tring to add new value into xml file like here i am sending you some main code:
This for loop is reading from the .res file and inserting value into xml file code is below:
for (i=0; i<form_data.area_count;i++, area_p="area_p-">next)
{
if(area_p->type==1)
{
-->error from this line-->// ImagePageNo==area_p->number;
fprintf(ofp , "\n\t\t<documentkey name="\"%s\"">", ImagePageNo);
print_documentkey_tag_end(ofp);
}
{
//some more code is here
}
}
Here as i had shown my error occurs like res2xml.exe access violation from that line which i had shown in above code.
when i comment this line code works fine.so this error occurs due to which problem that i can't getting?
can you help me into that?
|
|
|
|
|
Did you tried to use the debugger with breakpoints (F9 to set/remove breakpoints)?? This is much more helpfull than removing lines of code and seing if that works or not.
Check if area_p contains an adress that looks valid (other than 0x0000 or 0xccccc).
I cannot help you more. You really need to get used with the debugger because it is a very very helpfull tool for debugging applications (and it's really easy to use).
|
|
|
|
|
I have a problem with function RegEnumKeyEx in Windows XP. Variable
retCode obtain code 5 after first using function RegEnumKeyEx. Code
showed below
<br />
void CInstDlg::GetSubKeys(HKEY key, CString subStr, CStringArray &arr)<br />
{<br />
HKEY hKey;<br />
DWORD i, retCode, maxlen = MAX_PATH;<br />
CHAR achKey[MAX_PATH]; <br />
FILETIME ftLastWriteTime;<br />
<br />
retCode = RegOpenKeyEx(key, subStr, NULL, KEY_QUERY_VALUE, &hKey);<br />
<br />
for (i = 0, retCode = ERROR_SUCCESS;<br />
retCode == ERROR_SUCCESS; i++)<br />
{<br />
retCode = RegEnumKeyEx(hKey, i, achKey, &maxlen, NULL, NULL, NULL, <br />
&ftLastWriteTime);<br />
maxlen = MAX_PATH;<br />
if (retCode == ERROR_SUCCESS)<br />
arr.Add(achKey);<br />
}<br />
<br />
RegCloseKey(hKey);<br />
}<br />
VadimR
|
|
|
|
|
The key must have been opened with the KEY_ENUMERATE_SUB_KEYS access right.
suhredayan There is no spoon.
|
|
|
|
|
Thank you very much
VadimR
|
|
|
|
|
|
Hi all,
I'm using Visual C++.NET in a project involving image manipulation. The problem is that I'm getting different output using the MT or MTd Run-Time libraries. I've checked the inputs to the graphics functions (I can't check the functions itself because they're in a precompiled lib) and seem to be the same in both cases. Any suggestions on what's going on?
Thanks in advance.
|
|
|
|
|
Well.... VC++ uses different floating point libraries for the debug and release version. So you get different results. The main change is in precision.
Try applying breakpoints in release mode and check if you are getting the same result as in debug mode.
|
|
|
|
|
Anshul Solanki wrote:
VC++ uses different floating point libraries for the debug and release version.
OK, then I need to restate the question: could you point me to somewhere listing the main differences between debug and release libraries? Something I forgot to mention is that according to the theoretical results, the correct output is the one in debug mode. Otherwise I wouldn't be so concerned. Thanks again.
|
|
|
|
|
Hi
I want to overload [] [] operator for a Matrix class that I am writing. I think one of the solutions will overloading the operators incrementally. If someone has done this in past or has more ideas, please drop a line or bits of code.
generally, a templated version of overloading [ ] goes like:
e.g. template <class E> E& CMatrix<E>::operator [] (int index) const
{
return CMatrix::foo<E>[index];
}
Thanks
|
|
|
|
|
first of all, operator[][] doesn't exist in C++ !!!
what happens when you create a multi-dimensional array is in fact creating an array of arrays... d'you follow me ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I think (but I'm really not sure, it's too long that I didn't do that ) that you will need to define a new class that is the one dimension array (like you mentionned there, CMatrix::foo). And then inside this class, override the [] operator also. But, for the CMatrix operator, it will not return the E template but a foo class... (and then on this return you apply the second operator[] from foo class that returns your E template element).
Ok, but as I said I'm not sure anymore...
But another suggestion: why don't you use the STL vector class ? It is a template class that can manage one dimensionnal arrays. Then you make a vector of vector and you have your matrix. The advantage is that you don't need to write it all again, that it has been tested by thousands of people, ...
|
|
|
|