|
Hi,
Sorry for asking a powershell question. This should be easy for an expert.
Suppose I'm in the folder C:\Windows\System32 . I want to print out only "System32".
I have found commands that give the entire path, but I want only the last bit
Thanks,
Mel
|
|
|
|
|
You have posted the same question on 4 different forums; please, don't do it!
The best when asking something is to choose the forum that better matches your subject, and post a unique question explaining as better as possible what is your problem.
Thank you!
|
|
|
|
|
How to convert PDF to image file?
example:jpg file
Thank you
i want to use C language to do.
where is the conference code.
|
|
|
|
|
You probably need a library for the purpose (the other route would be reading the PDF specifications for implementing the decoding algorithm).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all
How can i use FilterIndex in CFileDialog?
Please help me
|
|
|
|
|
MsmVc wrote: How can i use FilterIndex in CFileDialog?
As specified by the documentation. MSDN gives even this sample code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi, I have a combo box in my application.
Whenever there is CB_SELCHANGE occurs, I need to perform some operation.
If the operation fails I need to reset the combo box to previous value.
My Trail:
Whenever there is a change in selection I am copying that item to a string variable (say str).
Now I am using CB_FINDSTRING to get the index using str by calling SendMessage. But it was not working.
I have confusion with LPARAM and WPARAM in SendMessage. Please give me the syntax of SendMessage
using CB_FINDSTRING.
Can you people throw me some idea?
Thanks in advance
msr
modified on Wednesday, October 27, 2010 1:43 AM
|
|
|
|
|
A bit of book-keeping would avoid the SendMessage stuff.
Anyway you probably have to write something like (assuming your str is a char* ):
LRESULT result = SendMessage(hWnd, CB_FINDSTRING, (WPARAM)-1, (LPARAM)str);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you. Now it is working. I have interchanged LPARAM and WPARAM parameters. Here is my code.
DWORD GetComboBoxIndex = 0;
GetComboBoxIndex = SendMessage(hWnd, CB_FINDSTRINGEXACT, -1, (LPARAM)str);
SendMessage(hWnd, CB_SETCURSEL, GetComboBoxIndex, NULL);
Regards
msr
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have the code about create many modeless dialog .
for(int i=0;i < 5;++i)
{
pRegionDlg[i] = new CRegionDlg ( this );
pRegionDlg[i]->Create( IDD_DIALOG , this );
pRegionDlg[i]->ShowWindow( SW_SHOW ) ;
}
this code is error heap . but I don't understand why it's error . while this code can run good on other program .
Thanks for reading and helping .
|
|
|
|
|
HTT90 wrote: this code is error heap . but I don't understand why it's error . while this code can run good on other program .
What is this supposed to mean? What error? Where? How was pRegionDlg declared? Please clarify.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Maybe 'the other program' properly allocates the pRegionDlg array.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I did :
in header file :
CRegionDlg *pRegionDlg[8] ;
and when I debug , I receive a message , it's inform me no loaded from dll . and heap is error .
|
|
|
|
|
Please don't define arrays in header files.
Please report full error message.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I don't know why now it's run good and no error . .
Can You say why don't define arrays in header files ?
I'm chicken . 
|
|
|
|
|
You should never define variables inside header files (headers are for declarations), because you may get multiple definitions of the same symbol (if, as usual, the header is included by many sources).
If you need to access a variable from multiple sources then you have to:
- Declare it as
extern inside an header file. - Define it inside just one source file.
- Include the header file into every source that needs to access the variable itself.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks . .
|
|
|
|
|
Hey,
Iam reading this book and Iam writing my own program aside.
Iam currently reading about some functions related to linux.
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc,char *env[])
{
int i=0;
cout << env[i] << endl;
return 0;
}
This is the program, now how would I actually put the output of env[i] into a string?
In my own program Iam playing around with conversions and string editing and stuff, now I need to convert the output of env[i] into a string though, not sure how to do that.
Thankfull for any help, greetins 
|
|
|
|
|
ALLERSLIT wrote: int main(int argc,char *env[])
This should probably be:
int main( int argc, char *argv[], char *env[] )
ALLERSLIT wrote: how would I actually put the output of env[i] into a string?
Have you tried:
std::string str = env[i];
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Oh thanks, gotcha!
let's say I wouldn't put
char *env[] there into the main() thingy, how would I be able to get the output of env[i] then?
Like
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
char *env[];
string str = env[9];
cout << str << endl;
return 0;
}
I get this error: |14|error: storage size of ‘env’ isn't known
Makes sense to me, but how would I avoid that error?
|
|
|
|
|
ALLERSLIT wrote: Makes sense to me, but how would I avoid that error?
By declaring env as:
char *env[10];
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
If I declare it the way you did, I can not put it into a string the same way i learned in the last post.
|
|
|
|
|
You seem to be misunderstanding main() 's signature and it's various formats. That said, what exactly is it that you are trying/wanting to do?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Trying to figure out how to get the outpuf of env[i] without putting all that other stuff into main()'s signature.
|
|
|
|