|
But as a last option this will do.
But I am sure that it won't take a year to do.
Nibu thomas.
VC++ Developer.
|
|
|
|
|
100s of dlls and 100 s of header file is not possible replacing
I have joined before two months and still I dont know how vast is this code
|| ART OF LIVING ||
|
|
|
|
|
Try to delete *.ncb, *.opt and *.aps files in your working folder. rebuild your app.
this helped me a lot of times.
|
|
|
|
|
How do i trim string from the left
Dinesh
|
|
|
|
|
The CString class has a method called TrimLeft(), use this.
Take a look at the MSDN documentation for more details.
MSDN: This method trims leading white-space characters from the string. It
also removes new line, space, and tab characters.
-- modified at 0:58 Monday 7th November, 2005
|
|
|
|
|
i cannot use mfc classes
i am doing emmbeded programming
or ishould say i dont know how can i use them
Please help
Dinesh
|
|
|
|
|
Dinu22 wrote: i am doing emmbeded programming
Do you mean winCE ? In this case CStrings are available.
If not, then I suppose you are working with char* as strings (or even TCHAR*), in this case you will have to code your own trim routine.
~RaGE();
|
|
|
|
|
Dinu22 wrote: or ishould say i dont know how can i use them
use StrTrim api defined in shlwapi.lib
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi Dinu,
Nothing to worry.
Since you are into embedded programming I strongly recommend you write one yourself.
Nibu thomas.
Software Developer.
|
|
|
|
|
I am using the following code works well but there is windows error please help
#include "CScreen.h"
int main()
{
char *Country = "ttttttttttttttt ttt";
FormatPrint(15,Country);
return 0;
}
Code CScreen.h
#include <iostream>
#include <string>
using namespace std;
void MakeStream(const char *FinalStr);
void FormatPrint(int format, const char *Str)
{
const int LIMIT = 15;//the maximum lenth the strng can display
char temp[]="A";
if (strlen(Str)<=16)
{
MakeStream(Str);
cout<<"firstif";
}
if(Str[LIMIT]==' ')
{
int i=0;
for (i=0 ;i<=LIMIT ;i++)
{
temp[i]=Str[i];
}
//strncpy(temp, Str, LIMIT);
MakeStream(temp);
}
else//serch for the first space in reverse order
{
cout<<""<<str<<"last else";
=""
="" }
}="" end="" formatprint="" function
void="" makestream(const="" char="" *finalstr)="" this="" is="" the="" actual="" fuction="" that="" displaya
{
="" cout<<"fuction="" parsed"<<finalstr;
=""
}<code="">
Dinesh
|
|
|
|
|
I want to learn the concept of device drivers and then write a program on how to create it using VC++.Can someone tell me how to go about it?
thanks in advance
Sushma
|
|
|
|
|
Hi
nice work! you can find some very good articles here[^]
Iman Ghasrfakhri
|
|
|
|
|
Thats good u can find
codeproject some good examples are provided
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
In addition to the other answers here, I think you should start with getting the Windows DDK. You will need it.
|
|
|
|
|
Dr. Newcomer is a SME on device drivers. See his book here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi guys,
I have a problem.
I would like to make the system menu the menu of my notify icon. The menu comes up but doesn't work. I am doing so that the user can work with the application even if it is hidden and I don't want to create another menu.;)
Is it possible to do this.
Thanks
Nibu thomas
|
|
|
|
|
Nibu thomas wrote: so that the user can work with the application even if it is hidden and I don't want to create another menu
AFAIK, you have manually route them using your custom Window Message Handller which you have mentioned while creating the System Tray Icon i.e. NOTIFYICONDATA.uCallbackMessage
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Yeah that is fine.
It is working like that.
But I wanted the system menu to be displayed as the tray icon menu. The menu is coming but not working. So I wanted to whether there is another way of going about this apart from using another menu.
Nibu thomas.
Software Developer.
|
|
|
|
|
I use Windows XP.
I created a new desktop named desktop2, switched to it using SwitchDesktop API and created a explorer process there using CreateProcess API.
Everything is fine, but the windows shortcut key is not working in the new desktop. If I use Win+E to get the explorer, explorer opens in the default desktop, not in the new one.
What can I do to get rid of this problem?
Thank you.
- NS -
|
|
|
|
|
I have a class that takes this list of name value pairs:
<mydocs> - C:\docs and sets\user\my documents
<home> - C:\docs and sets\user
and then there is a function, that substitutes these variables in "<home>\\local settings".
but I dont know what to name this class. any suggestions?
thanks!
|
|
|
|
|
-----> hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{AfxMessageBox("Failed To Connect Datasource"); }
My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.
Detailed code is below
void OleList::ExecuteQuery(CString str,bool refreshcol,bool fillcheckbox)
{
ptr=new CObArray;
USES_CONVERSION;
CDataSource db;
-----> HRESULT hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{
AfxMessageBox("Failed To Connect Datasource");
return;
}
CSession session;
session.Open(db);
int i=0;
CCommand product;
CString temp=GenerateSQL();
LONG row;
char tt[50];
hr=product.Open(session,temp, NULL, &row, DBGUID_DEFAULT, true);
if (FAILED(hr))
{
AfxMessageBox("Failed To Create Table");
return;
}
if(refreshcol)
{
// coltype.RemoveAll();
DBTYPE pType;//=NULL;
for(ULONG j=0;j< product.GetColumnCount() && j < colsize;j++)
if(product.GetColumnType(j+1,&pType))
coltype->SetAt(j,pType);
}
i=0;
if(product.MoveFirst()==S_OK)
do{
CStringArray* sarr=new CStringArray;
sarr->SetSize(colsize);
for(int k=1;k<=colsize;k++)
{
CString st;
switch(coltype->GetAt(k-1))
{
case DBTYPE_STR :
{
char* tm=(char*)product.GetValue(k);
st=A2T(tm);break;
}
case DBTYPE_DBTIMESTAMP : st=GetTime(product.GetValue(k)); break;
case DBTYPE_BOOL : GetBool(product.GetValue(k),&st); break;
case DBTYPE_R4 : GetFloat(product.GetValue(k),&st); break;
case DBTYPE_R8 : GetDouble(product.GetValue(k),&st); break;
case DBTYPE_I4 : GetLong(product.GetValue(k),&st); break;
case DBTYPE_I2 : GetSort(product.GetValue(k),&st); break;
case DBTYPE_UI1 : GetUInt(product.GetValue(k),&st); break;
}
/*if(k==1)
InsertItem(i,st);
else
SetItemText(i,k-1,st);*/
st.TrimRight();
sarr->SetAt(k-1,st);
}
ptr->Add(sarr);
i++;
product.FreeRecordMemory();
}while(product.MoveNext()==S_OK);
if(checkarr!=NULL)
checkarr->RemoveAll();
checkarr=new CWordArray;
checkarr->SetSize(i);
for(int m=0;m checkarr->SetAt(m,fillcheckbox+1);
SetItemCountEx(i);
//char tt[50];
//AfxMessageBox(itoa(i,tt,10));
// SetItemCount(i);
Invalidate();
m_HeaderCtrl.listsize=i;
m_HeaderCtrl.checkarr=checkarr;
product.Close();
session.Close();
db.Close();
m_HeaderCtrl.ptr=ptr;
SetCursor(hcurSave);
}
My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.
|| ART OF LIVING ||
-- modified at 23:11 Sunday 6th November, 2005
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/vcrefcdatasourceopen.asp[^]
shivditya wrote: HRESULT hr = db.Open(_T("SQLOLEDB.1"), dbinit);
SQLOLEDB.1 is plainly not a Prog ID for a data source you have available to you on this machine, or it has a password that you've not provided. I have SQL Server installed, and SQLOLEDB.1 does not exist in my registry ( I didn't expect it to ). Where did this code come from ? Did it ever work ? I reckon it's been copied and pasted from the web. If this is what your senior programmer does ( copy/paste/give it to someone to make it work ), I'd be looking for a job.
shivditya wrote: Actually senior programmer who developed code left for me to debug
It looks like a mess to me, this is written by the senior programmer you say ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Truely speaking this entire function in his code working very properly when i am trying to implement it is refusing to connect.
In our firm there is only one database.One thing is sure he has used some OleDB concept ,second thing you can find word SQLOLEDB
In msdn
|| ART OF LIVING ||
-- modified at 1:40 Monday 7th November, 2005
|
|
|
|
|
shivditya wrote: In our firm there is only one database.
That's lovely. Obviously, his computer is configured to use it and yours is not. So why don't you ask him ?
shivditya wrote: second thing you can find word SQLOLEDB
In msdn
I'm sure you can, but if it relates to a prog ID that gets set up by SQL Server automatically, it would be set up on my computer. MSDN said to pass in a prog ID, which would be in the registry if it was set up.
Instead of asking the same question over and over, and not following up on the advice people give you, go and ask the guy who wrote the code, because it's obvious the issue is one of setting up the database connection on your machine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why don't you try to open the database connection in a database gui tool, and see what happens?
You might get interesting information about the problem that way.
Just a thought...
|
|
|
|