|
Do you need to multiple languages?.Does other program a foreign program or its your program that you wrote
|
|
|
|
|
Yes I need multiple languages.
Abut other program: it is some program that reads text from File_2 and set it to SQl. Sow I cant change it.
|
|
|
|
|
For one part see multilingual support for applications [^] is helpfuls
and for two section on the text file you have only characters on the a program you can change font but (Im not sure its possible or no )maybe you insert a sql statement in the first line of file for font and then run this statment on the sql
|
|
|
|
|
|
You're welcome.I hope you write your program early;)
|
|
|
|
|
Hi,
I am using GetJob function with JOB_INFO_2 & wants to retrieve dmCopies, a member of DEVMODE structure, but it always returns 1 to me. I am using XP & printing through MS-Word 2003. Also I have placed a registry entry
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options
ForceSetCopyCount 1
which is a hotfix given by Microsoft for this. Can anybody help.
Smile.
Is it not clear.
-- modified at 3:03 Wednesday 16th May, 2007
|
|
|
|
|
Mmm, let me see if I understand you.
You change the number of copies to be printed and still get 1 in dmCopies, although you have changed it? Or where is the problem?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
HI everyone,
I was trying to make a tool using visual C++ which
uses my self made MATLAB codes and I am supposed to access them in
my C++ project and derive the corresponding results.
Alternatively, I can say that I read the inputs in my C++ and have to
compute the results using the MATLAB codes.
For all these I am supposed to make shared libraries. But when I used
mcc command (thx to code project only), my machine's MATLAB said no
such command exists and even the DOS prompt failed to recognise.
Can anyone help me out in this or suggest me an alternative.
Looking forward to guidance from someone.
1vick
|
|
|
|
|
That question is asked a couple times a month. Search the forum, 'Search Comments', for MATLAB and read some of the past discussions.
led mike
|
|
|
|
|
This article[^] should give you an introduction how to make a DLL from a MatLab code and how to use it from C/C++.
However, to build the DLL (or an EXE) you will need the MatLab Compiler (mcc). If the mcc comand fails on your machine, you most propably don't have the MatLab Compiler installed. If I remember correctly, it is not part of the basic installation but must be bought separately (as many other MatLab toolboxes, too).
Regards,
Tim
|
|
|
|
|
Right now I run the code with a administrator user and works just fine, but when I do it with a limited account user the first time works just fine but the second time gives me this error: ERROR_ALREADY_EXISTS = Cannot Create a file when that file already exists.
This is what I'm doing:
1.- LogonUser; with the administrator account.
2.- ImpersonateLoggedOnUser
3.- RegOpenKeyEx
Does anyone knows how to work this around?
Any help is greatly apreciated.
Thanks...
JH
|
|
|
|
|
A normal user does not have authority to modify/add existing values in HKLM so if you are specifying KEY_READ | KEY_WRITE as 'samDesired' the RegOpenKeyEx will fail. If you are only going to read leave off the KEY_WRITE, but if you need to modify the value, put it somewhere other than HKLM.
This is why most software has to be installed by someone with admin authority; most software installs write to HKLM.
|
|
|
|
|
First of all, thanks...skornel.
I understand your answer, however; I am trying to enable and disable the USB Ports (HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR), which is already by default. It's not something that I created my self.
Is there a way to modify this key val when the program is running with a limited account?.
Thanks.
Regards,
JH
|
|
|
|
|
I don't know of any way to change any value in HKLM from a normal user account that does not have admin rights.
The only thing I can think of would be for someone with admin rights, to change the permissions on the HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services
to allow modify rights to a particular group and then be sure the user is in that group. That may work but I've not tried it.
'Permissions...' is in the right-button context menu in RegEdit.
|
|
|
|
|
skornel wrote: A normal user does not have authority to modify/add existing values in HKLM so if you are specifying KEY_READ | KEY_WRITE as 'samDesired' the RegOpenKeyEx will fail. If you are only going to read leave off the KEY_WRITE, but if you need to modify the value, put it somewhere other than HKLM.
True, but what does all of this have to do with ERROR_ALREADY_EXISTS ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is because, actually you change value in HKCU not in HKLM.
You said, it works for first time and it fails for second time. Well, it works first because there is no key exist before and you have write access. So this is HKCU. It fails second because, you already wrote it when your first time. Probably you do not check result of ImpersonateLoggedOnUser function.
modified on Thursday, May 14, 2009 2:42 AM
|
|
|
|
|
Perhaps you meant to reply to the OP, but after 2 years he may have moved on.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi, I have an application that I've been running for about 2 years in a production environment and there seems to be a small problem that I think might be the OS, though it doesn't make sense.
The program is running on Windows Server 2003 with SP1. The machine is a dual processor with 2 cores. 4 GB of memory. The program has 9 threads in the pool, and set to use 4 concurrently.
Basically, the program is a distributor of data. One connection sends data, and the program delivers it to other connections if they want it.
There's about 12 connections. 11 of them are local, and 1 is over a DS3.
Anyway, of the 12 connections, the one that is over the DS3 is having the problems. I've done some wireshark sniffs and nothing looks wrong. Plenty of window size, no missing packets, no resends.
The problem is that on that one socket, the WSASend notification sometimes takes 3-4 seconds when it gets really busy. All the other connections that are local don't have the problem. Looking at the sniff, during the 3-4 seconds when no WSASend notification is coming in, I am getting plenty of acknowledgements from the receiving end every 10-20 milliseconds. Also plenty of data is going out. There is no 3-4 second pause in either data being sent or acknowledgements coming in. Nothing close to it even.
So it looks like the OS is queuing up these notifications, but for some reason is only targetting the connection over the DS3, which doesn't make sense...
Any ideas?
|
|
|
|
|
I have been searching the net for a simple database application using visual c++. I want somebody to help me with how to develop just a small application for entering records, deleting, updating and searching using visual c++ and ms sql server 2005. Even if it can be for one record, I can extend that to whatever the number of columns I have in my database. I have been developing some but all in vain. Nothing seems to work.
Please!
phokojoe
|
|
|
|
|
phokojoe wrote: Nothing seems to work
What have you tried that didn't work? Is the problem UI related? Database access related?
phokojoe wrote: how to develop just a small application for entering records, deleting, updating and searching
Maybe break that down into managable chunks and show some sample code that you're having trouble
with and we can hopefully help you out.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
You need to look into using the CDatabase[^] class. Below is come code to read some records from an Access DB which can be easily modified for MS SQL Server. Using those two classes you can update, read, create, etc. I believe I got much of this original code from CP but I cannot for the life of me remember where so I can't credit the author.
CDatabase m_database;
CRecordset *m_recset;
bool Read()
{
CString SqlString;
CString sVideoName, sFileLocationRelative;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = "Database\\VideoDB2.mdb";
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
TRY
{
m_database.Open(NULL,false,false,sDsn);
m_recset = new CRecordset( &m_database );
SqlString = "SELECT * FROM VIDEOS";
m_recset->Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
while( !m_recset->IsEOF() )
{
VideoRecord tVideo;
CDBVariant vID;
CDBVariant vRunTime;
CDBVariant vName;
CDBVariant vImagePath;
CDBVariant vVideoPath;
CDBVariant vDescription;
m_recset->GetFieldValue("VIDEO_ID", vID);
m_recset->GetFieldValue("VIDEO_RUN_TIME", vRunTime);
m_recset->GetFieldValue("VIDEO_NAME", vName);
m_recset->GetFieldValue("VIDEO_IMAGE_PATH",vImagePath);
m_recset->GetFieldValue("VIDEO_PATH", vVideoPath);
m_recset->GetFieldValue("VIDEO_DESCRIPTION",vDescription);
tVideo.iVideoID = vID.m_iVal;
tVideo.lRunTime = vRunTime.m_lVal;
tVideo.stVideoName = *vName.m_pstring;
tVideo.stImagePath = *vImagePath.m_pstring;
tVideo.stVideoPath = *vVideoPath.m_pstring;
tVideo.stDescription = *vDescription.m_pstring;
m_vVideos.push_back(tVideo);
m_recset->MoveNext();
}
m_recset->Close();
}
CATCH(CDBException, e)
{
AfxMessageBox("Database error: "+e->m_strError);
return false;
}
END_CATCH;
return true;
}
By the way, that VideoRecord structure was just a part of my program, so you can ignore it.
Hope this is helpful,
Dustin
|
|
|
|
|
I have an view derived from CScrollView and I make the image fit to width so my horizontal scrollbar disappears. Problem is, I need that scrollbar to remain visible so user can add additional space to the image by clicking the scroll buttons.
I would like to continue to use CScrollView as it still saves a tad bit amount of work and code compared to CView but I'm not having much luck getting the scrollbars to remain visible.
I've tried adding some addtional padding space around the image but it has an undesireable effect and I'm trying to mimic the functionality of some commercial products that do not appear to use padding around the image.
Does anyone know how to force the scrollbars in CScrollView to remain visible and enabled?
|
|
|
|
|
bob16972 wrote: Does anyone know how to force the scrollbars in CScrollView to remain visible and enabled?
Try calling SetScrollSizes() in OnInitialUpdate() after the call to the base class. Add the amount of additional space you need.
|
|
|
|
|
Unfortunately, I do that already dynamically as the view size changes (use SetScrollSizes() that is) and I tried adding some padding to force the scroll bars to remain visilbe but the effect would be somewhat confusing to the user as it is a fit to width application.
Some commercial products allow the user to temporarily scroll beyond the image edge and add some drawing primitive or object and recalculate the page size and readjust the scroll sizes on the next view resize or scroll bar action to remove the excess space that wasn't needed. They leave the horizontal scroll bar visible but the thumb is full size (or darn near close to it). VC++ 6.0 kinda does this when you scroll past the bottom of a document.
Thanks for taking the time to give me some advice. When it appears that I might be creating more work than necessary, I like to get some professional feedback as a sanity check. Unfortunatley, it looks like I'm going to have to derive from CView at this point.
Thanks again and take care.
|
|
|
|
|
I'm not sure how much you're going to have to fight the MFC code to do this.
Take a look at the source (viewscrl.cpp), particularly all the calls to SetScrollInfo() and
SetScrollRange().
There's the SIF_DISABLENOSCROLL flag for SetScrollInfo() but while letting the bar remain shown,
it will be disabled which isn't what you need.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|